Getting Up and Running Locally
Getting Up and Running Locally with Docker
Prerequisites
You should have Docker and Docker Compose in your system. Go to the installation instructions to download Docker and the instructions to download Docker Compose.
- Run this command in the root directory of the Django project to build the stack:
(You will find "react-frontend" in the docker-compose file. Comment out it if you would like to use React.)
docker-compose -f local.yml build
- Run the stack
docker-compose -f local.yml up
and then
docker-compose up
- If you would like to execute commands like "migrate", "createsuperuser", you can use this commands
docker-compose -f local.yml run --rm django python manage.py migrate
docker-compose -f local.yml run --rm django python manage.py createsuperuser
Configuration
Environment Variables
You can change the env variables for your needs. You can find them in
.envs
├── .local
│ ├── .django
│ └── .postgres
└── .production
├── .django
└── .postgres
If you would need to merge .envs/.production/*
in a single file, you can run the command
python merge_production_dotenvs_in_dotenv.py
For more information using Docker with HyperSaas, you can visit Django Cookiecutter Docs