]> git.parisson.com Git - teleforma.git/commitdiff
Add env file and related settings params
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 5 Feb 2019 00:39:55 +0000 (01:39 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 5 Feb 2019 00:39:55 +0000 (01:39 +0100)
app/settings.py
docker-compose.yml
env/debug.env [new file with mode: 0644]

index de467411fc79a28a79fa5b5dbdc3856ca7ebc0c1..13019bd9662e70199b5def731acf2a60aa991014 100644 (file)
@@ -7,24 +7,26 @@ from django.core.urlresolvers import reverse_lazy
 
 sys.dont_write_bytecode = True
 
-DEBUG = True
+# Django settings for server project.
+DEBUG = env('DEBUG')  # False if not in os.environ
 TEMPLATE_DEBUG = DEBUG
 
+ALLOWED_HOSTS = ['*']
+
 ADMINS = (
     ('Guillaume Pellerin', 'webmaster@parisson.com'),
-    ('Lists', 'lists@parisson.com'),
 )
 
 MANAGERS = ADMINS
 
 DATABASES = {
     'default': {
-        'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-        'NAME': 'teleforma',                      # Or path to database file if using sqlite3.
-        'USER': 'teleforma',                      # Not used with sqlite3.
-        'PASSWORD': 'HMYsrZLEtYeBrvER',                  # Not used with sqlite3.
-        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
-        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
+        'ENGINE': env('ENGINE'),  # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
+        'USER': env('MYSQL_USER'),      # Not used with sqlite3.
+        'PASSWORD': env('MYSQL_PASSWORD'),  # Not used with sqlite3.
+        'NAME': env('MYSQL_DATABASE'),
+        'HOST': 'db',      # Set to empty string for localhost. Not used with sqlite3.
+        'PORT': '3306',   # Set to empty string for default. Not used with sqlite3.
     }
 }
 
index 5b1af4df78fa2295c8676a9bc773fc94c9681fe6..6b2a8af5c7939348de1e79c3f14b8cffa653c883 100644 (file)
@@ -39,6 +39,8 @@ services:
       - db
       - borker
       - search
+    env_file:
+      - env/debug.env
 
   web:
     image: nginx
diff --git a/env/debug.env b/env/debug.env
new file mode 100644 (file)
index 0000000..77bc2b6
--- /dev/null
@@ -0,0 +1,31 @@
+## MYSQL DATABASE
+
+ENGINE=django.db.backends.mysql
+MYSQL_ROOT_PASSWORD=mysecretpassword
+MYSQL_DATABASE=teleforma
+MYSQL_USER=teleforma
+MYSQL_PASSWORD=mysecretpassword
+
+## DJANGO
+
+DEBUG=True
+SECRET_KEY=ghv8us258zefoifh7n97dq&w$c((o5rj_$-9d-8j57y_a9og8wux1h7
+
+## CELERY
+
+# replace broker by localhost if you start your app outside docker-compose
+BROKER_URL=redis://broker:6379/0
+
+# if this is True, all tasks will be executed locally by blocking until the task returns.
+CELERY_ALWAYS_EAGER=False
+
+## HAYSTACK
+
+# if this is True, the search index will be rebuild
+REINDEX=False
+
+HAYSTACK_URL=http://search:9200/
+
+# change index names if hosting multiple search containers
+HAYSTACK_INDEX_NAME=teleforma
+HAYSTACK_INDEX_NAME_AUTOCOMPLETE=teleforma_auto