diff --git a/core/core/settings.py b/core/core/settings.py index 615ecdc..58b6635 100644 --- a/core/core/settings.py +++ b/core/core/settings.py @@ -33,6 +33,11 @@ ALLOWED_HOSTS = [os.getenv('HTTP_HOST', '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" # Application definition @@ -46,18 +51,24 @@ INSTALLED_APPS = [ 'django.contrib.staticfiles', 'django_extensions', 'rest_framework', - 'rest_framework.authtoken', + 'knox', 'drf_yasg', 'channels', + 'authentication', 'files', 'inventory', 'notify_sessions', ] 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 = { 'SECURITY_DEFINITIONS': { 'api_key': {