Testing deployment of a django app as dockers (django+gunicorn+nginx+postgresql). Based on post at https://blog.bitsacm.in/django-on-docker/
Go to file
The Dod 4498dd8a39 README edit and screenshots 2021-01-12 13:18:47 +02:00
djangoproject Add a fixture with some items 2021-01-12 12:46:44 +02:00
nginx Initial commit 2021-01-11 17:09:58 +02:00
screenshots README edit and screenshots 2021-01-12 13:18:47 +02:00
.gitignore Add static files and bootstrap 2021-01-12 12:38:31 +02:00
README.md README edit and screenshots 2021-01-12 13:18:47 +02:00
dev.env Add a minimalistic app + allow for dev env 2021-01-11 21:14:42 +02:00
docker-compose.yml Initial commit 2021-01-11 17:09:58 +02:00
project.env.example Add a minimalistic app + allow for dev env 2021-01-11 21:14:42 +02:00

README.md

Based on example at https://blog.bitsacm.in/django-on-docker/ (django+gunicorn+nginx+postgresql on docker)

To install local dev server (sqlite3, and DEBUG):

  • virtualenv -p python3 venv
  • . venv/bin/activate
  • pip install -r djangoproject/requirements.txt

To run local dev server

  • First time in a shell, run . venv/bin/activate, and . dev.env
  • cd djangoproject
  • Perform first time operations (see below)
  • ./manage.py runserver and browse to http://localhost:8000

To deploy dockers locally

  • You should copy project.env.example to project.env and edit it.
  • docker-compose up would then run the server on http://localhost:8888
  • docker exec -it django /bin/bash will let you perform first time operations (see below)

First time operations

Whether on local dev server or on a docker, you should do 2 things:

  • ./manage.py createsuperuser (so that you can manage the site via web)
  • ./manage.py loaddata billboard/fixtures/initial-data.json (Optional. Populates the db with a few items)

Screenshots

App

Admin