2014-10-01 16:13:21 +04:00
|
|
|
import os
|
|
|
|
import sys
|
2014-05-02 23:58:41 +04:00
|
|
|
|
2014-05-03 01:55:39 +04:00
|
|
|
PROJECT_ROOT = os.path.abspath(os.path.split(os.path.split(__file__)[0])[0])
|
2015-12-04 11:32:03 +03:00
|
|
|
|
2014-05-03 01:55:39 +04:00
|
|
|
ROOT_URLCONF = 'urls'
|
|
|
|
STATIC_URL = '/static/'
|
|
|
|
STATIC_ROOT = '%s/staticserve' % PROJECT_ROOT
|
|
|
|
STATICFILES_DIRS = (
|
|
|
|
('global', '%s/static' % PROJECT_ROOT),
|
|
|
|
)
|
|
|
|
UPLOADS_DIR_NAME = 'uploads'
|
|
|
|
MEDIA_URL = '/%s/' % UPLOADS_DIR_NAME
|
|
|
|
MEDIA_ROOT = os.path.join(PROJECT_ROOT, '%s' % UPLOADS_DIR_NAME)
|
2014-05-02 23:58:41 +04:00
|
|
|
|
|
|
|
IS_DEV = False
|
|
|
|
IS_STAGING = False
|
|
|
|
IS_PROD = False
|
2014-05-06 02:53:06 +04:00
|
|
|
IS_TEST = 'test' in sys.argv or 'test_coverage' in sys.argv
|
2014-05-02 22:53:42 +04:00
|
|
|
|
2015-11-19 11:38:57 +03:00
|
|
|
DATABASES = {
|
|
|
|
'default': {
|
|
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
|
|
'NAME': ':memory:',
|
2014-05-02 22:53:42 +04:00
|
|
|
}
|
2015-11-19 11:38:57 +03:00
|
|
|
}
|
2014-05-02 22:53:42 +04:00
|
|
|
|
2017-12-05 08:39:32 +03:00
|
|
|
MIDDLEWARE = [
|
2014-10-02 14:39:47 +04:00
|
|
|
'django.middleware.common.CommonMiddleware',
|
|
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
|
|
'django.contrib.messages.middleware.MessageMiddleware'
|
|
|
|
]
|
|
|
|
|
2017-12-05 08:39:32 +03:00
|
|
|
# Adding for backwards compatibility for Django 1.8 tests
|
|
|
|
MIDDLEWARE_CLASSES = MIDDLEWARE
|
|
|
|
|
2014-10-08 14:19:15 +04:00
|
|
|
TEMPLATE_CONTEXT_PROCESSORS = [
|
|
|
|
'django.contrib.auth.context_processors.auth',
|
|
|
|
'django.core.context_processors.debug',
|
|
|
|
'django.core.context_processors.media',
|
|
|
|
'django.core.context_processors.request',
|
|
|
|
'django.contrib.messages.context_processors.messages',
|
|
|
|
'django.core.context_processors.static',
|
|
|
|
|
|
|
|
"allauth.account.context_processors.account",
|
|
|
|
"allauth.socialaccount.context_processors.socialaccount",
|
|
|
|
]
|
|
|
|
|
2016-06-28 21:14:05 +03:00
|
|
|
# avoid deprecation warnings during tests
|
|
|
|
TEMPLATES = [
|
|
|
|
{
|
|
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
|
|
'DIRS': [
|
|
|
|
# insert your TEMPLATE_DIRS here
|
|
|
|
],
|
|
|
|
'APP_DIRS': True,
|
|
|
|
'OPTIONS': {
|
|
|
|
'context_processors': TEMPLATE_CONTEXT_PROCESSORS,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2016-01-04 20:45:33 +03:00
|
|
|
REST_FRAMEWORK = {
|
|
|
|
'DEFAULT_AUTHENTICATION_CLASSES': (
|
|
|
|
'rest_framework.authentication.SessionAuthentication',
|
|
|
|
'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2014-05-02 22:53:42 +04:00
|
|
|
INSTALLED_APPS = [
|
2014-05-02 23:58:41 +04:00
|
|
|
'django.contrib.admin',
|
2014-05-02 23:03:25 +04:00
|
|
|
'django.contrib.auth',
|
2014-05-03 01:47:28 +04:00
|
|
|
'django.contrib.humanize',
|
2014-05-02 23:58:41 +04:00
|
|
|
'django.contrib.contenttypes',
|
|
|
|
'django.contrib.sessions',
|
2014-05-03 01:47:28 +04:00
|
|
|
'django.contrib.sites',
|
|
|
|
'django.contrib.sitemaps',
|
|
|
|
'django.contrib.staticfiles',
|
2014-05-02 23:58:41 +04:00
|
|
|
|
2014-10-01 16:13:21 +04:00
|
|
|
'allauth',
|
|
|
|
'allauth.account',
|
2014-10-08 14:19:15 +04:00
|
|
|
'allauth.socialaccount',
|
|
|
|
'allauth.socialaccount.providers.facebook',
|
2016-07-18 08:06:28 +03:00
|
|
|
'allauth.socialaccount.providers.twitter',
|
2014-10-01 16:13:21 +04:00
|
|
|
|
2014-05-02 23:58:41 +04:00
|
|
|
'rest_framework',
|
|
|
|
'rest_framework.authtoken',
|
|
|
|
|
2014-05-02 22:53:42 +04:00
|
|
|
'rest_auth',
|
2016-01-04 20:45:33 +03:00
|
|
|
'rest_auth.registration',
|
|
|
|
|
|
|
|
'rest_framework_jwt'
|
2014-05-02 22:53:42 +04:00
|
|
|
]
|
|
|
|
|
|
|
|
SECRET_KEY = "38dh*skf8sjfhs287dh&^hd8&3hdg*j2&sd"
|
2014-05-02 23:58:41 +04:00
|
|
|
ACCOUNT_ACTIVATION_DAYS = 1
|
2014-05-03 01:47:28 +04:00
|
|
|
SITE_ID = 1
|
2016-06-28 21:14:05 +03:00
|
|
|
|
|
|
|
AUTHENTICATION_BACKENDS = (
|
|
|
|
# Needed to login by username in Django admin, regardless of `allauth`
|
|
|
|
'django.contrib.auth.backends.ModelBackend',
|
|
|
|
# `allauth` specific authentication methods, such as login by e-mail
|
|
|
|
'allauth.account.auth_backends.AuthenticationBackend',
|
|
|
|
)
|