Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Commit

Permalink
Environ definition
Browse files Browse the repository at this point in the history
  • Loading branch information
shirishgoyal committed Jan 4, 2016
1 parent bea37d2 commit d456466
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
37 changes: 18 additions & 19 deletions csp/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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,
Expand All @@ -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'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
3 changes: 3 additions & 0 deletions local_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-r requirements.txt

flake8==2.5.1

0 comments on commit d456466

Please sign in to comment.