Browse Source

Add local settings

Baptiste Jonglez 9 years ago
parent
commit
ff9b5716b3
2 changed files with 26 additions and 1 deletions
  1. 19 1
      INSTALL.md
  2. 7 0
      celutz/settings.py

+ 19 - 1
INSTALL.md

@@ -30,8 +30,26 @@ should look like this:
     virtualenv -p /usr/bin/python3 ~/mycelutzvenv
     . ~/mycelutzvenv/bin/activate
     pip install -r requirements.txt
-    # Configure database if needed
+
+Configuration
+-------------
+
+To configure the application, don't edit `celutz/settings.py` directly, but
+instead create a file `celutz/local_settings.py` with your local modifications.
+
+Some things you should (must?) configure:
+
+- `SECRET_KEY`
+- `ALLOWED_HOSTS`
+- `DEBUG`
+- database configuration
+
+Then run the migrations:
+
     python manage.py migrate
+
+And create a superuser:
+
     python manage.py createsuperuser
 
 Production

+ 7 - 0
celutz/settings.py

@@ -103,3 +103,10 @@ PANORAMA_MAX_DISTANCE = 50000
 BROKER_URL = 'django://'
 CELERY_TASK_SERIALIZER = 'json'
 CELERY_ACCEPT_CONTENT = ['json']
+
+# Local settings overriding
+try:
+    from celutz.local_settings import *
+except ImportError:
+    pass
+