mirror of
https://github.com/thecyberlearn/modern-django-starter.git
synced 2026-08-18 19:52:55 +00:00
- Add configure_site management command to create Django Site object - Configure site domain as dt.netcoptech.com during startup (like quantum-digital) - Update both compose files to run configure_site after migrations - This fixes the 'relation django_site does not exist' error on /accounts/login/ Django Allauth requires a Site object to work properly.
23 lines
970 B
YAML
23 lines
970 B
YAML
services:
|
|
web:
|
|
build: .
|
|
ports:
|
|
- "8000:8000"
|
|
environment:
|
|
- DEBUG=False
|
|
- ALLOWED_HOSTS=dt.netcoptech.com,localhost,127.0.0.1
|
|
- DATABASE_URL=${DATABASE_URL}
|
|
- SECRET_KEY=${SECRET_KEY}
|
|
- DJANGO_SETTINGS_MODULE=django_project.settings.production
|
|
- CSRF_TRUSTED_ORIGINS=https://dt.netcoptech.com
|
|
- SECURE_SSL_REDIRECT=True
|
|
- GOOGLE_OAUTH2_CLIENT_ID=${GOOGLE_OAUTH2_CLIENT_ID:-demo-google-client-id}
|
|
- GOOGLE_OAUTH2_CLIENT_SECRET=${GOOGLE_OAUTH2_CLIENT_SECRET:-demo-google-client-secret}
|
|
command: >
|
|
sh -c "python manage.py migrate &&
|
|
python manage.py create_groups &&
|
|
python manage.py setup_social_apps &&
|
|
python manage.py configure_site --domain=dt.netcoptech.com --name='Django Template' &&
|
|
python manage.py collectstatic --noinput &&
|
|
gunicorn --bind 0.0.0.0:8000 --workers 3 --timeout 120 django_project.wsgi:application"
|