Browse Source

Certain parametres passe sur l'environnement

Maxime Raynal 7 years ago
parent
commit
5aeb7a871f
1 changed files with 4 additions and 2 deletions
  1. 4 2
      speed_rack/speed_rack/settings.py

+ 4 - 2
speed_rack/speed_rack/settings.py

@@ -23,9 +23,10 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 SECRET_KEY = '-lqwwip#2#)_k)bmg^9%!mfb6kqtfn@r%mu1q8ceoc@ecj653#'
 SECRET_KEY = '-lqwwip#2#)_k)bmg^9%!mfb6kqtfn@r%mu1q8ceoc@ecj653#'
 
 
 # SECURITY WARNING: don't run with debug turned on in production!
 # SECURITY WARNING: don't run with debug turned on in production!
-DEBUG = True
+DEBUG = bool(os.environ.get('SR_DEBUG', True))
 
 
-ALLOWED_HOSTS = []
+hostname = os.environ.get('SR_HOSTNAME', 'localhost') 
+ALLOWED_HOSTS = [hostname]
 
 
 
 
 # Application definition
 # Application definition
@@ -121,3 +122,4 @@ USE_TZ = True
 # https://docs.djangoproject.com/en/1.11/howto/static-files/
 # https://docs.djangoproject.com/en/1.11/howto/static-files/
 
 
 STATIC_URL = '/static/'
 STATIC_URL = '/static/'
+STATIC_ROOT = os.path.join(BASE_DIR, 'static')