From d4564664c47f1d0c51f66229bdb1c750e9e75e61 Mon Sep 17 00:00:00 2001 From: Shirish Goyal Date: Mon, 4 Jan 2016 20:47:45 +0530 Subject: [PATCH] Environ definition --- csp/settings.py | 37 ++++++++++++++++++------------------- local_requirements.txt | 3 +++ 2 files changed, 21 insertions(+), 19 deletions(-) create mode 100644 local_requirements.txt diff --git a/csp/settings.py b/csp/settings.py index cd198e7f..1d6a9463 100644 --- a/csp/settings.py +++ b/csp/settings.py @@ -12,6 +12,7 @@ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import logging + import os import django import dj_database_url @@ -96,7 +97,7 @@ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'static/django_templates')], - 'APP_DIRS':True, + 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', @@ -161,21 +162,6 @@ SENDGRID_API_KEY = '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' # Others -REGISTRATION_ALLOWED = False -PASSWORD_RESET_ALLOWED = True - -LOGIN_URL = '/login' -# SESSION_ENGINE = 'redis_sessions.session' - -# Security -# SESSION_COOKIE_SECURE = True -# CSRF_COOKIE_SECURE = True -PYTHON_VERSION = 2 -try: - from local_settings import * -except Exception as e: - pass - GRAPH_MODELS = { 'all_applications': True, 'group_models': True, @@ -186,8 +172,6 @@ os.path.join(BASE_DIR, 'fixtures') ) -USERNAME_MAX_LENGTH = 30 - # Google Drive GOOGLE_DRIVE_CLIENT_ID = '960606345011-3bn8sje38i9c0uo8p87ln6tfb2dhco9v.apps.googleusercontent.com' GOOGLE_DRIVE_CLIENT_SECRET = 'v-gWQKOmuAhTmbJ5REwH-V_1' @@ -222,6 +206,13 @@ 'daemo-staging.herokuapp.com', 'daemo-staging.stanford.edu' ] +REGISTRATION_ALLOWED = os.environ.get('REGISTRATION_ALLOWED', False) +PASSWORD_RESET_ALLOWED = True + +LOGIN_URL = '/login' +USERNAME_MAX_LENGTH = 30 + + # MANAGER CONFIGURATION # ------------------------------------------------------------------------------ # See: https://docs.djangoproject.com/en/dev/ref/settings/#admins @@ -288,8 +279,16 @@ class SuppressDeprecated(logging.Filter): def filter(self, record): warnings = [ 'RemovedInDjango18Warning', - 'RemovedInDjango19Warning' + 'RemovedInDjango19Warning', + 'RemovedInDjango110Warning', ] # Return false to suppress message. return not any([warn in record.getMessage() for warn in warnings]) + + +PYTHON_VERSION = 2 +try: + from local_settings import * +except Exception as e: + pass diff --git a/local_requirements.txt b/local_requirements.txt new file mode 100644 index 00000000..0249e3d9 --- /dev/null +++ b/local_requirements.txt @@ -0,0 +1,3 @@ +-r requirements.txt + +flake8==2.5.1