This is my personal website and blog
- Python 3.9
conda activate digcaverns_dev
pip install -r requirements.txt
- Docker
sudo apt-get update
sudo apt-get install docker-compose-plugin
- Postgres
sudo apt-get update
sudo apt-get install postgresql-client
# PostgreSQL environment variables
POSTGRES_DB=digcavernsdb
POSTGRES_USER=postgres
POSTGRES_PASSWORD=
POSTGRES_HOST=db # This is the service name defined in docker-compose for PostgreSQL
POSTGRES_PORT=5432
POSTGRES_URL=db:5432 # 'db' is the service name and '5432' is the default PostgreSQL port
# Superuser credentials
DJANGO_SUPERUSER_USERNAME=
DJANGO_SUPERUSER_EMAIL=
DJANGO_SUPERUSER_PASSWORD=
# Secrets
SECRET_KEY=
# Runtime
DEBUG=1 # Use 1 for True
If you wish to run the project in your venv only simply do:
python manage.py runserver
Ensure have a database running with configs set according to settings.py
.
The easies way to run the application and avoid installing software in system. Bring service up:
sudo docker compose up
Verify services are running:
sudo docker ps
Bring services down:
sudo docker compose down -v
Run manage.py commands:
sudo docker compose run web python manage.py <command>
Run migrations (example):
sudo docker compose run web python manage.py makemigrations
sudo docker compose run web python manage.py migrate
psql -d digcavernsdb -U postgres -h localhost -p 5432
- Use
--insecure
to run withDEBUG=False
mode - Otherwise, need to add some webserver