Skip to content

ctwillie/template-django-docker

Repository files navigation

Setup Instructions

  1. Create and activate a virtual environment in the root of the project
python -m virtualenv venv
source venv/bin/activate
  1. Install dependencies
pip install -r requirements.txt
  1. Run cp .env.example .env

  2. Generate a secret to populate DJANGO_SECRET_KEY in .env

# generate a secret from the command line
python -c "import secrets; print(secrets.token_hex())"
  1. Run the docker containers: docker compose up

  2. Run the database migrations in the web container

docker compose exec web sh
# inside the container
python manage.py migrate
  1. Create a super user
docker compose exec web sh
# inside the container
python manage.py createsuperuser
  1. Navigate to localhost:8000

About

A dockerized Django template project

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published