8000 GitHub - data-setup/django-core: Django with Postgres, Gunicorn, and Nginx
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

data-setup/django-core

Repository files navigation

Django Project with Postgres, Gunicorn, and Nginx

Features

Installation

$ python -m venv venv

Windows

$ Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser $ .venv\Scripts\Activate.ps1

macOS

python3 -m venv venv

$ source venv/bin/activate

(venv) $ pip install -r requirements.txt (venv) $ pip install -r requirements.txt (venv) $ python manage.py createsuperuser (venv) $ python manage.py runserver

Load the site at http://127.0.0.1:8000

Docker

To use Docker with PostgreSQL as the database update the DATABASES section of django_project/settings.py to reflect the following:

# django_project/settings.py
DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.postgresql",
        "NAME": "postgres",
        "USER": "postgres",
        "PASSWORD": "postgres",
        "HOST": "db",  # set in docker-compose.yml
        "PORT": 5432,  # default postgres port
    }
}

And then proceed to build the Docker image, run the container, and execute the standard commands within Docker.

$ docker-compose up -d --build $ docker-compose exec web python manage.py migrate $ docker-compose exec web python manage.py createsuperuser

Load the site at http://127.0.0.1:8000

Create products.json

python manage.py loaddata products.json

About

Django with Postgres, Gunicorn, and Nginx

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0