You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
134 lines
3.4 KiB
134 lines
3.4 KiB
""" |
|
Django settings for authserver project. |
|
|
|
Generated by 'django-admin startproject' using Django 2.1.1. |
|
|
|
For more information on this file, see |
|
https://docs.djangoproject.com/en/2.1/topics/settings/ |
|
|
|
For the full list of settings and their values, see |
|
https://docs.djangoproject.com/en/2.1/ref/settings/ |
|
""" |
|
|
|
import os |
|
|
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
|
|
|
|
|
# Quick-start development settings - unsuitable for production |
|
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ |
|
|
|
# SECURITY WARNING: keep the secret key used in production secret! |
|
SECRET_KEY = 'h$p_vf^h$h@cebvgeynhda3-@i&+f-(3k9w-qsftn_+!-o_)$0' |
|
|
|
# SECURITY WARNING: don't run with debug turned on in production! |
|
DEBUG = True |
|
|
|
# Application definition |
|
|
|
INSTALLED_APPS = [ |
|
'django.contrib.admin', |
|
'django.contrib.auth', |
|
'django.contrib.contenttypes', |
|
'django.contrib.sessions', |
|
'django.contrib.messages', |
|
'django.contrib.staticfiles', |
|
'rest_framework', |
|
'rest_framework.authtoken', |
|
'corsheaders', |
|
'authserver.api', |
|
] |
|
|
|
REST_FRAMEWORK = { |
|
'DEFAULT_AUTHENTICATION_CLASSES': ( |
|
'rest_framework.authentication.SessionAuthentication', |
|
'rest_framework.authentication.TokenAuthentication', |
|
), |
|
} |
|
|
|
MIDDLEWARE = [ |
|
'corsheaders.middleware.CorsMiddleware', |
|
'django.middleware.security.SecurityMiddleware', |
|
'django.contrib.sessions.middleware.SessionMiddleware', |
|
'django.middleware.common.CommonMiddleware', |
|
'django.middleware.csrf.CsrfViewMiddleware', |
|
'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
'django.contrib.messages.middleware.MessageMiddleware', |
|
'django.middleware.clickjacking.XFrameOptionsMiddleware', |
|
] |
|
|
|
ROOT_URLCONF = 'authserver.urls' |
|
|
|
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', |
|
], |
|
}, |
|
}, |
|
] |
|
|
|
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') |
|
|
|
WSGI_APPLICATION = 'authserver.wsgi.application' |
|
|
|
ALLOWED_HOSTS = ['localhost', '127.0.0.1', '172.17.17.65', 'tools-auth.protospace.ca'] |
|
|
|
#CORS_ORIGIN_WHITELIST = ( |
|
# 'localhost:8000', |
|
#) |
|
|
|
CORS_ORIGIN_ALLOW_ALL = True |
|
|
|
# Database |
|
# https://docs.djangoproject.com/en/2.1/ref/settings/#databases |
|
|
|
DATABASES = { |
|
'default': { |
|
'ENGINE': 'django.db.backends.sqlite3', |
|
'NAME': os.path.join(BASE_DIR, 'data/db.sqlite3'), |
|
} |
|
} |
|
|
|
|
|
# Password validation |
|
# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators |
|
|
|
AUTH_PASSWORD_VALIDATORS = [] |
|
|
|
|
|
# Internationalization |
|
# https://docs.djangoproject.com/en/2.1/topics/i18n/ |
|
|
|
LANGUAGE_CODE = 'en-us' |
|
|
|
TIME_ZONE = 'UTC' |
|
|
|
USE_I18N = True |
|
|
|
USE_L10N = True |
|
|
|
USE_TZ = True |
|
|
|
|
|
# Static files (CSS, JavaScript, Images) |
|
# https://docs.djangoproject.com/en/2.1/howto/static-files/ |
|
|
|
STATIC_URL = '/static/' |
|
|
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'data') |
|
MEDIA_URL = '/media/' |
|
|
|
PROTOSPACE_LOGIN_PAGE = 'https://my.protospace.ca/login' |
|
|
|
FIRMWARE_VERSION_MAGIC = 'MRWIZARD' |
|
|
|
UPGRADE_GROUPS = ['Critical', 'Testing', 'Development']
|
|
|