2017-08-03 12:41:30 +02:00
|
|
|
import os
|
|
|
|
|
|
|
|
import django
|
|
|
|
|
|
|
|
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
|
|
|
|
|
|
|
SECRET_KEY = 'iamaplop'
|
|
|
|
|
|
|
|
DEBUG = True
|
|
|
|
|
|
|
|
INSTALLED_APPS = [
|
|
|
|
'django.contrib.admin',
|
|
|
|
'django.contrib.auth',
|
|
|
|
'django.contrib.contenttypes',
|
|
|
|
'django.contrib.messages',
|
2018-01-02 17:06:12 +01:00
|
|
|
'django.contrib.sessions',
|
2017-08-03 12:41:30 +02:00
|
|
|
'django.contrib.sites',
|
|
|
|
'django.contrib.staticfiles',
|
|
|
|
|
2017-09-16 02:41:30 +02:00
|
|
|
'debug_toolbar',
|
2017-08-03 12:41:30 +02:00
|
|
|
'widget_tweaks',
|
|
|
|
|
|
|
|
'allauth_ens',
|
|
|
|
'allauth',
|
|
|
|
'allauth.account',
|
|
|
|
'allauth.socialaccount',
|
|
|
|
'allauth_cas',
|
|
|
|
|
|
|
|
'allauth.socialaccount.providers.facebook',
|
|
|
|
'allauth.socialaccount.providers.google',
|
|
|
|
'allauth_ens.providers.clipper',
|
|
|
|
|
|
|
|
'app',
|
|
|
|
]
|
|
|
|
|
|
|
|
_MIDDLEWARES = [
|
|
|
|
'django.middleware.common.CommonMiddleware',
|
2017-09-16 02:41:30 +02:00
|
|
|
'debug_toolbar.middleware.DebugToolbarMiddleware',
|
2017-08-03 12:41:30 +02:00
|
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
|
|
'django.contrib.sites.middleware.CurrentSiteMiddleware',
|
|
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
|
|
|
]
|
|
|
|
|
|
|
|
if django.VERSION >= (1, 10):
|
|
|
|
MIDDLEWARE = _MIDDLEWARES
|
|
|
|
else:
|
|
|
|
MIDDLEWARE_CLASSES = _MIDDLEWARES
|
|
|
|
|
|
|
|
ROOT_URLCONF = 'urls'
|
|
|
|
|
2018-01-02 17:06:12 +01:00
|
|
|
SITE_ID = 1
|
|
|
|
|
|
|
|
WSGI_APPLICATION = 'wsgi.application'
|
|
|
|
|
|
|
|
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
|
|
|
|
2017-08-03 12:41:30 +02:00
|
|
|
TEMPLATES = [
|
|
|
|
{
|
|
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
|
|
'DIRS': [],
|
|
|
|
'APP_DIRS': True,
|
|
|
|
'OPTIONS': {
|
|
|
|
'context_processors': [
|
|
|
|
'django.template.context_processors.debug',
|
|
|
|
'django.template.context_processors.request',
|
|
|
|
'django.contrib.auth.context_processors.auth',
|
|
|
|
'django.contrib.messages.context_processors.messages',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
DATABASES = {
|
|
|
|
'default': {
|
|
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
|
|
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
AUTH_PASSWORD_VALIDATORS = [
|
|
|
|
{
|
2018-01-02 17:06:12 +01:00
|
|
|
'NAME': (
|
|
|
|
'django.contrib.auth.password_validation'
|
2018-03-28 13:07:36 +02:00
|
|
|
'.UserAttributeSimilarityValidator'
|
2018-01-02 17:06:12 +01:00
|
|
|
),
|
2017-08-03 12:41:30 +02:00
|
|
|
},
|
|
|
|
{
|
2018-01-02 17:06:12 +01:00
|
|
|
'NAME': (
|
|
|
|
'django.contrib.auth.password_validation'
|
|
|
|
'.MinimumLengthValidator'
|
|
|
|
),
|
2017-08-03 12:41:30 +02:00
|
|
|
},
|
|
|
|
{
|
2018-01-02 17:06:12 +01:00
|
|
|
'NAME': (
|
|
|
|
'django.contrib.auth.password_validation'
|
|
|
|
'.CommonPasswordValidator'
|
|
|
|
),
|
2017-08-03 12:41:30 +02:00
|
|
|
},
|
|
|
|
{
|
2018-01-02 17:06:12 +01:00
|
|
|
'NAME': (
|
|
|
|
'django.contrib.auth.password_validation'
|
|
|
|
'.NumericPasswordValidator'
|
|
|
|
),
|
2017-08-03 12:41:30 +02:00
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
LANGUAGE_CODE = 'en-us'
|
|
|
|
|
|
|
|
TIME_ZONE = 'Europe/Paris'
|
|
|
|
|
|
|
|
USE_I18N = True
|
|
|
|
|
|
|
|
USE_L10N = True
|
|
|
|
|
|
|
|
USE_TZ = True
|
|
|
|
|
|
|
|
STATIC_URL = '/static/'
|
|
|
|
|
2017-09-16 02:41:30 +02:00
|
|
|
DEBUG_TOOLBAR_CONFIG = {
|
|
|
|
'SHOW_TOOLBAR_CALLBACK': lambda r: True,
|
|
|
|
}
|
|
|
|
|
2018-01-02 17:06:12 +01:00
|
|
|
AUTHENTICATION_BACKENDS = [
|
|
|
|
'django.contrib.auth.backends.ModelBackend',
|
|
|
|
'allauth.account.auth_backends.AuthenticationBackend',
|
|
|
|
]
|
2017-08-03 12:41:30 +02:00
|
|
|
|
|
|
|
LOGIN_URL = '/account/login/'
|
2017-09-16 02:41:30 +02:00
|
|
|
LOGIN_REDIRECT_URL = 'user-view'
|
|
|
|
ACCOUNT_LOGOUT_REDIRECT_URL = 'view'
|
2017-08-03 12:41:30 +02:00
|
|
|
|
|
|
|
SOCIALACCOUNT_QUERY_EMAIL = True
|
|
|
|
|
|
|
|
# allauth settings
|
|
|
|
|
2018-01-02 17:06:12 +01:00
|
|
|
ACCOUNT_ADAPTER = 'adapter.AccountAdapter'
|
2017-08-03 12:41:30 +02:00
|
|
|
ACCOUNT_AUTHENTICATED_LOGIN_REDIRECTS = False
|
2018-01-02 17:06:12 +01:00
|
|
|
ACCOUNT_AUTHENTICATION_METHOD = 'username_email'
|
|
|
|
|
|
|
|
SOCIALACCOUNT_ADAPTER = 'adapter.SocialAccountAdapter'
|
|
|
|
|
|
|
|
# allauth_ens settings
|
|
|
|
|
|
|
|
ACCOUNT_HOME_URL = 'home'
|
|
|
|
ACCOUNT_DETAILS_URL = '/my-account/'
|