add custom authentication and know in settings.py
This commit is contained in:
parent
0f911589ca
commit
0438eb0b6a
1 changed files with 13 additions and 2 deletions
|
@ -33,6 +33,11 @@ ALLOWED_HOSTS = [os.getenv('HTTP_HOST', 'localhost')]
|
||||||
|
|
||||||
MAIL_DOMAIN = os.getenv('MAIL_DOMAIN', 'localhost')
|
MAIL_DOMAIN = os.getenv('MAIL_DOMAIN', 'localhost')
|
||||||
|
|
||||||
|
CSRF_TRUSTED_ORIGINS = ["https://" + host for host in ALLOWED_HOSTS]
|
||||||
|
|
||||||
|
LEGACY_USER_NAME = os.getenv('LEGACY_API_USER', 'legacy_user')
|
||||||
|
LEGACY_USER_PASSWORD = os.getenv('LEGACY_API_PASSWORD', 'legacy_password')
|
||||||
|
|
||||||
SYSTEM3_VERSION = "0.0.0-dev.0"
|
SYSTEM3_VERSION = "0.0.0-dev.0"
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
@ -46,18 +51,24 @@ INSTALLED_APPS = [
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
'django_extensions',
|
'django_extensions',
|
||||||
'rest_framework',
|
'rest_framework',
|
||||||
'rest_framework.authtoken',
|
'knox',
|
||||||
'drf_yasg',
|
'drf_yasg',
|
||||||
'channels',
|
'channels',
|
||||||
|
'authentication',
|
||||||
'files',
|
'files',
|
||||||
'inventory',
|
'inventory',
|
||||||
'notify_sessions',
|
'notify_sessions',
|
||||||
]
|
]
|
||||||
|
|
||||||
REST_FRAMEWORK = {
|
REST_FRAMEWORK = {
|
||||||
'TEST_REQUEST_DEFAULT_FORMAT': 'json'
|
'TEST_REQUEST_DEFAULT_FORMAT': 'json',
|
||||||
|
'DEFAULT_AUTHENTICATION_CLASSES': ('knox.auth.TokenAuthentication',),
|
||||||
|
'DEFAULT_PERMISSION_CLASSES': (
|
||||||
|
'rest_framework.permissions.IsAuthenticated', 'rest_framework.permissions.DjangoModelPermissions'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AUTH_USER_MODEL = 'authentication.ExtendedUser'
|
||||||
|
|
||||||
SWAGGER_SETTINGS = {
|
SWAGGER_SETTINGS = {
|
||||||
'SECURITY_DEFINITIONS': {
|
'SECURITY_DEFINITIONS': {
|
||||||
'api_key': {
|
'api_key': {
|
||||||
|
|
Loading…
Reference in a new issue