Django Template - Easy setup for development or production environment with Docker
- Python 3.11 (Dockerfile.dev / Dockerfile.prod)
- Python Decouple
- Dj Database URL
- Gunicorn
- Support to PostgreSQL with psycopg-binary
- Support to pytest and pytest-django
Important! Update "myProject" with the name from your project
See the docs about Django templates
PROJECT_NAME=myProject && \
python -m venv .venv && \
source .venv/bin/activate && \
python -m pip install --upgrade pip && \
python -m pip install django
django-admin startproject --template https://github.com/allansbo/django-docker-quickstart/archive/master.zip --name=.env.dev,.env.prod,pytest.ini,docker-compose.prod.yml $PROJECT_NAME . && \
pip install --prefer-binary -r app/requirements-dev.txt && \
git init && \
git add . && \
git commit -m 'Initial import'
Important! Update the .env files with your settings
Uses the default Django development server.
docker-compose -f docker-compose.dev.yml up -d --build
- Run at http://localhost:8000/
Uses gunicorn + nginx.
docker-compose -f docker-compose.prod.yml up -d --build
- Run at http://localhost:80