File tree Expand file tree Collapse file tree 6 files changed +48
-24
lines changed
Expand file tree Collapse file tree 6 files changed +48
-24
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ services:
3636 - " 8000:8000"
3737 environment :
3838 - DJANGO_SETTINGS_MODULE=editgroups.settings.docker
39+ - RUN_MIGRATIONS=true
3940 depends_on :
4041 db :
4142 condition : service_healthy
@@ -49,6 +50,7 @@ services:
4950 - .:/app
5051 environment :
5152 - DJANGO_SETTINGS_MODULE=editgroups.settings.docker
53+ - C_FORCE_ROOT=true
5254 depends_on :
5355 - db
5456 - redis
Original file line number Diff line number Diff line change 22
33set -e
44
5- echo " Waiting for PostgreSQL... "
5+ echo " Waiting for PostgreSQL"
66while ! nc -z db 5432; do
77 sleep 0.1
88done
99echo " PostgreSQL started"
1010
11- echo " Running migrations..."
12- python manage.py migrate --noinput
11+ if [ " $RUN_MIGRATIONS " = " true" ]; then
12+ echo " Running migrations"
13+ python manage.py migrate --noinput
1314
14- echo " Collecting static files... "
15- python manage.py collectstatic --noinput
15+ echo " Collecting static files"
16+ python manage.py collectstatic --noinput
1617
17- echo " Creating superuser if it doesn't exist... "
18- python manage.py shell -c "
18+ echo " Creating superuser if it doesn't exist"
19+ python manage.py shell -c "
1920from django.contrib.auth import get_user_model
2021User = get_user_model()
2122if not User.objects.filter(username='admin').exists():
@@ -24,5 +25,6 @@ if not User.objects.filter(username='admin').exists():
2425else:
2526 print('Superuser already exists')
2627" || true
28+ fi
2729
2830exec " $@ "
Original file line number Diff line number Diff line change 1- from .common import *
2-
3- DEBUG = True
4- ALLOWED_HOSTS = ['*' ]
5-
6- SECRET_KEY = '20oj&tj8uaruseitlrise,tries,uirsetur36746209etus7e'
1+ import os
2+ import sys
3+ from types import ModuleType
74
8- DATABASES = {
5+ secret = ModuleType ('editgroups.settings.secret' )
6+ secret .SECRET_KEY = '20oj&tj8uaruseitlrise,tries,uirsetur36746209etus7e'
7+ secret .DATABASES = {
98 'default' : {
109 'ENGINE' : 'django.db.backends.postgresql_psycopg2' ,
1110 'NAME' : 'editgroups' ,
1615 'DISABLE_SERVER_SIDE_CURSORS' : False ,
1716 }
1817}
18+ secret .SOCIAL_AUTH_MEDIAWIKI_KEY = 'your_mediawiki_key'
19+ secret .SOCIAL_AUTH_MEDIAWIKI_SECRET = 'your_mediawiki_secret'
20+ secret .SOCIAL_AUTH_MEDIAWIKI_URL = 'https://www.wikidata.org/w/index.php'
21+ secret .SOCIAL_AUTH_MEDIAWIKI_CALLBACK = 'http://localhost:8000/oauth/complete/mediawiki/'
22+ secret .REDIS_HOST = 'redis'
23+ secret .REDIS_PORT = 6379
24+ secret .REDIS_DB = 0
25+ secret .REDIS_PASSWORD = ''
26+ secret .REDIS_KEY_PREFIX = 'editgroups_'
1927
20- SOCIAL_AUTH_MEDIAWIKI_KEY = 'your_mediawiki_key'
21- SOCIAL_AUTH_MEDIAWIKI_SECRET = 'your_mediawiki_secret'
22- SOCIAL_AUTH_MEDIAWIKI_URL = 'https://www.wikidata.org/w/index.php'
23- SOCIAL_AUTH_MEDIAWIKI_CALLBACK = 'http://localhost:8000/oauth/complete/mediawiki/'
28+ sys .modules ['editgroups.settings.secret' ] = secret
2429
25- REDIS_HOST = 'redis'
26- REDIS_PORT = 6379
27- REDIS_DB = 0
28- REDIS_PASSWORD = ''
29- REDIS_KEY_PREFIX = 'editgroups_'
30+ from . common import *
31+
32+ DEBUG = True
33+ ALLOWED_HOSTS = [ '*' ]
34+ BASE_DIR = os . path . dirname ( os . path . dirname ( __file__ ))
Original file line number Diff line number Diff line change 1- ../ app .py
1+ """
2+ WSGI config for editgroups project.
3+
4+ It exposes the WSGI callable as a module-level variable named ``application``.
5+
6+ For more information on this file, see
7+ https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
8+ """
9+
10+ import os
11+
12+ from django .core .wsgi import get_wsgi_application
13+
14+ os .environ .setdefault ("DJANGO_SETTINGS_MODULE" , "editgroups.settings" )
15+
16+ application = app = get_wsgi_application ()
You can’t perform that action at this time.
0 commit comments