2015-10-03 01:07:05 +00:00
|
|
|
import os
|
2017-01-31 21:50:28 +00:00
|
|
|
from .environment_settings import *
|
2015-10-03 01:07:05 +00:00
|
|
|
|
|
|
|
def local_dir(entry):
|
|
|
|
return os.path.join(
|
|
|
|
os.path.dirname(os.path.dirname(__file__)),
|
|
|
|
entry
|
|
|
|
)
|
|
|
|
|
2017-01-31 21:03:03 +00:00
|
|
|
DJANGO_BASE_PATH = os.path.dirname(os.path.dirname(__file__))
|
|
|
|
|
2015-10-03 01:07:05 +00:00
|
|
|
WSGI_APPLICATION = 'bornhack.wsgi.application'
|
|
|
|
ROOT_URLCONF = 'bornhack.urls'
|
|
|
|
|
2016-11-09 08:55:15 +00:00
|
|
|
|
2015-10-05 16:35:30 +00:00
|
|
|
SITE_ID = 1
|
|
|
|
|
2016-11-09 15:02:17 +00:00
|
|
|
ADMINS = (
|
|
|
|
('bornhack sysadm', 'sysadm@bornhack.org'),
|
|
|
|
)
|
|
|
|
|
2015-10-03 01:07:05 +00:00
|
|
|
INSTALLED_APPS = [
|
|
|
|
'django.contrib.admin',
|
|
|
|
'django.contrib.auth',
|
|
|
|
'django.contrib.contenttypes',
|
|
|
|
'django.contrib.sessions',
|
|
|
|
'django.contrib.messages',
|
|
|
|
'django.contrib.staticfiles',
|
2015-10-05 16:35:30 +00:00
|
|
|
'django.contrib.sites',
|
|
|
|
|
2017-04-15 17:35:18 +00:00
|
|
|
'channels',
|
|
|
|
|
2016-02-20 22:39:02 +00:00
|
|
|
'profiles',
|
|
|
|
'camps',
|
2016-05-10 20:20:01 +00:00
|
|
|
'shop',
|
2016-05-30 19:36:14 +00:00
|
|
|
'news',
|
2016-05-30 19:51:17 +00:00
|
|
|
'utils',
|
2016-07-05 21:43:18 +00:00
|
|
|
'villages',
|
2016-07-13 19:44:09 +00:00
|
|
|
'program',
|
2016-12-25 14:52:55 +00:00
|
|
|
'info',
|
2017-01-24 23:24:04 +00:00
|
|
|
'sponsors',
|
2017-01-30 11:05:11 +00:00
|
|
|
'ircbot',
|
2017-03-31 15:29:28 +00:00
|
|
|
'teams',
|
2017-07-11 20:50:31 +00:00
|
|
|
'people',
|
2017-08-17 15:52:22 +00:00
|
|
|
'tickets',
|
2017-08-26 01:48:02 +00:00
|
|
|
'bar',
|
2017-10-03 19:14:07 +00:00
|
|
|
'backoffice',
|
2016-02-20 22:39:02 +00:00
|
|
|
|
2015-10-05 16:35:30 +00:00
|
|
|
'allauth',
|
|
|
|
'allauth.account',
|
|
|
|
'bootstrap3',
|
2017-03-09 23:07:13 +00:00
|
|
|
'django_extensions',
|
2015-10-03 01:07:05 +00:00
|
|
|
]
|
|
|
|
|
2017-07-15 13:21:00 +00:00
|
|
|
#MEDIA_URL = '/media/'
|
2015-10-03 01:07:05 +00:00
|
|
|
STATIC_URL = '/static/'
|
|
|
|
STATIC_ROOT = local_dir('static')
|
2015-10-05 16:35:30 +00:00
|
|
|
STATICFILES_DIRS = [local_dir('static_src')]
|
2015-10-03 01:07:05 +00:00
|
|
|
LANGUAGE_CODE = 'en-us'
|
2017-01-22 11:59:57 +00:00
|
|
|
#USE_I18N = True
|
|
|
|
#USE_L10N = True
|
2015-10-03 01:07:05 +00:00
|
|
|
USE_TZ = True
|
2017-01-22 11:59:57 +00:00
|
|
|
SHORT_DATE_FORMAT = 'd/m-Y'
|
|
|
|
DATE_FORMAT = 'd/m-Y'
|
|
|
|
DATETIME_FORMAT = 'd/m-Y H:i'
|
|
|
|
TIME_FORMAT = 'H:i'
|
2015-10-03 01:07:05 +00:00
|
|
|
|
|
|
|
TEMPLATES = [
|
|
|
|
{
|
|
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
|
|
'DIRS': [local_dir('templates')],
|
|
|
|
'APP_DIRS': True,
|
|
|
|
'OPTIONS': {
|
|
|
|
'context_processors': [
|
|
|
|
'django.template.context_processors.debug',
|
|
|
|
'django.template.context_processors.request',
|
2017-07-15 09:00:59 +00:00
|
|
|
'django.template.context_processors.media',
|
2015-10-03 01:07:05 +00:00
|
|
|
'django.contrib.auth.context_processors.auth',
|
|
|
|
'django.contrib.messages.context_processors.messages',
|
2016-05-14 17:39:34 +00:00
|
|
|
'shop.context_processors.current_order',
|
2016-12-28 23:15:13 +00:00
|
|
|
'camps.context_processors.camp',
|
2015-10-03 01:07:05 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2015-10-05 16:35:30 +00:00
|
|
|
AUTHENTICATION_BACKENDS = (
|
2016-12-25 14:52:55 +00:00
|
|
|
'django.contrib.auth.backends.ModelBackend', # Handles login to admin with username
|
|
|
|
'allauth.account.auth_backends.AuthenticationBackend', # Handles regular logins
|
2015-10-05 16:35:30 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
ACCOUNT_AUTHENTICATION_METHOD = 'email'
|
|
|
|
ACCOUNT_EMAIL_REQUIRED = True
|
|
|
|
ACCOUNT_EMAIL_VERIFICATION = True
|
2016-02-20 02:00:08 +00:00
|
|
|
ACCOUNT_EMAIL_SUBJECT_PREFIX = '[bornhack] '
|
2015-10-05 16:35:30 +00:00
|
|
|
ACCOUNT_USERNAME_REQUIRED = False
|
2017-03-09 23:01:02 +00:00
|
|
|
LOGIN_REDIRECT_URL='/'
|
2015-10-05 16:35:30 +00:00
|
|
|
LOGIN_URL = '/login/'
|
2016-04-25 17:08:55 +00:00
|
|
|
|
|
|
|
ACCOUNT_DEFAULT_HTTP_PROTOCOL = 'https'
|
2016-05-06 20:51:07 +00:00
|
|
|
|
|
|
|
BOOTSTRAP3 = {
|
2016-05-06 21:30:07 +00:00
|
|
|
'jquery_url': '/static/js/jquery.min.js',
|
|
|
|
'javascript_url': '/static/js/bootstrap.min.js'
|
2016-05-06 20:51:07 +00:00
|
|
|
}
|
2017-01-31 22:26:45 +00:00
|
|
|
MIDDLEWARE = [
|
|
|
|
'django.middleware.security.SecurityMiddleware',
|
|
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
|
|
'django.middleware.common.CommonMiddleware',
|
|
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
|
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
|
|
]
|
2016-05-10 15:55:54 +00:00
|
|
|
|
2016-12-25 14:52:55 +00:00
|
|
|
if DEBUG:
|
|
|
|
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
2017-04-15 17:35:18 +00:00
|
|
|
INSTALLED_APPS += [
|
|
|
|
'debug_toolbar',
|
|
|
|
]
|
2017-03-31 15:29:28 +00:00
|
|
|
MIDDLEWARE = ['debug_toolbar.middleware.DebugToolbarMiddleware'] + MIDDLEWARE
|
|
|
|
INTERNAL_IPS = "127.0.0.1"
|
2017-04-15 17:35:18 +00:00
|
|
|
DEBUG_TOOLBAR_PANELS = [
|
|
|
|
'debug_toolbar.panels.versions.VersionsPanel',
|
|
|
|
'debug_toolbar.panels.timer.TimerPanel',
|
|
|
|
'debug_toolbar.panels.settings.SettingsPanel',
|
|
|
|
'debug_toolbar.panels.headers.HeadersPanel',
|
|
|
|
'debug_toolbar.panels.request.RequestPanel',
|
|
|
|
'debug_toolbar.panels.sql.SQLPanel',
|
|
|
|
'debug_toolbar.panels.staticfiles.StaticFilesPanel',
|
|
|
|
'debug_toolbar.panels.templates.TemplatesPanel',
|
|
|
|
'debug_toolbar.panels.cache.CachePanel',
|
|
|
|
'debug_toolbar.panels.signals.SignalsPanel',
|
|
|
|
'debug_toolbar.panels.logging.LoggingPanel',
|
|
|
|
'debug_toolbar.panels.redirects.RedirectsPanel',
|
|
|
|
]
|
2017-06-05 21:22:12 +00:00
|
|
|
else:
|
|
|
|
SESSION_COOKIE_SECURE=True
|
|
|
|
CSRF_COOKIE_SECURE=True
|
2016-12-25 14:52:55 +00:00
|
|
|
|
|
|
|
LOGGING = {
|
|
|
|
'version': 1,
|
|
|
|
'disable_existing_loggers': False,
|
2017-03-23 17:32:13 +00:00
|
|
|
'formatters': {
|
|
|
|
'syslog': {
|
|
|
|
'format': '%(levelname)s %(name)s.%(funcName)s(): %(message)s'
|
|
|
|
},
|
|
|
|
'console': {
|
|
|
|
'format': '[%(asctime)s] %(name)s.%(funcName)s() %(levelname)s %(message)s',
|
|
|
|
'datefmt': '%d/%b/%Y %H:%M:%S'
|
2016-12-25 14:52:55 +00:00
|
|
|
},
|
2017-03-23 17:32:13 +00:00
|
|
|
},
|
|
|
|
'handlers': {
|
2016-12-25 14:52:55 +00:00
|
|
|
'console': {
|
2017-03-23 17:32:13 +00:00
|
|
|
'level': 'DEBUG',
|
|
|
|
'class': 'logging.StreamHandler',
|
|
|
|
'formatter': 'console'
|
2016-12-25 14:52:55 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
'loggers': {
|
2017-03-28 07:17:08 +00:00
|
|
|
# send the bornhack logger to console at DEBUG level,
|
2017-03-23 17:32:13 +00:00
|
|
|
# do not propagate bornhack.* messages up to the root logger
|
|
|
|
'bornhack': {
|
|
|
|
'handlers': ['console'],
|
|
|
|
'level': 'DEBUG',
|
|
|
|
'propagate': False,
|
2016-12-25 14:52:55 +00:00
|
|
|
},
|
2017-03-23 17:32:13 +00:00
|
|
|
},
|
2016-12-25 14:52:55 +00:00
|
|
|
}
|
|
|
|
|
2017-04-19 07:29:19 +00:00
|
|
|
|