mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-12-01 21:33:45 +03:00
78 lines
2.2 KiB
Python
78 lines
2.2 KiB
Python
DATABASES = {
|
|
'default': {
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
'NAME': ':memory:',
|
|
}
|
|
}
|
|
|
|
MIDDLEWARE = [
|
|
'django.middleware.common.CommonMiddleware',
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
'django.contrib.messages.middleware.MessageMiddleware'
|
|
]
|
|
|
|
TEMPLATES = [
|
|
{
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
'APP_DIRS': True,
|
|
'OPTIONS': {
|
|
'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",
|
|
],
|
|
},
|
|
},
|
|
]
|
|
|
|
REST_FRAMEWORK = {
|
|
'DEFAULT_AUTHENTICATION_CLASSES': (
|
|
'rest_framework.authentication.SessionAuthentication',
|
|
'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
|
|
)
|
|
}
|
|
|
|
INSTALLED_APPS = [
|
|
'django.contrib.admin',
|
|
'django.contrib.auth',
|
|
'django.contrib.humanize',
|
|
'django.contrib.contenttypes',
|
|
'django.contrib.sessions',
|
|
'django.contrib.sites',
|
|
'django.contrib.sitemaps',
|
|
'django.contrib.staticfiles',
|
|
|
|
'allauth',
|
|
'allauth.account',
|
|
'allauth.socialaccount',
|
|
'allauth.socialaccount.providers.facebook',
|
|
'allauth.socialaccount.providers.twitter',
|
|
|
|
'rest_framework',
|
|
'rest_framework.authtoken',
|
|
|
|
'rest_auth',
|
|
'rest_auth.registration',
|
|
|
|
'rest_framework_jwt'
|
|
]
|
|
|
|
SECRET_KEY = "38dh*skf8sjfhs287dh&^hd8&3hdg*j2&sd"
|
|
ACCOUNT_ACTIVATION_DAYS = 1
|
|
SITE_ID = 1
|
|
|
|
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',
|
|
)
|