This is a sample repository for starting django project. I collected some features and software stack. It uses:
- Django
- uwsgi
- nginx
- PostgreSQL
- Env file for database credentials and for hiding django secret key from a repository to environment variable
- Docker for developing and production deploying
- Common logs folder for keeping in one place
-
git clone git@github.com:mikhailmakarov/django-template.git .
-
cp .env_example .env
-
Specify secret key in .env file
-
docker-compose up
-
Open connection to uwsgi container and apply deployment script for django
- Open a new terminal
- docker ps
- docker exec -it /bin/bash
- sh deploy/deploy.sh
- . venv/bin/activate && python3 project/manage.py createsuperuser
- exit
-
Now you can pass to url: http://127.0.0.1/admin/
For developing you can uncomment two lines in Dockerfile and docker-compose.yml. It will open 8000 port and run django native server. Also use DEBUG=True in .env file for debugging.