| 1 |
""" |
| 2 |
Django test settings for cas_server application. |
| 3 |
|
| 4 |
Generated by 'django-admin startproject' using Django 1.9.7. |
| 5 |
|
| 6 |
For more information on this file, see |
| 7 |
https://docs.djangoproject.com/en/1.9/topics/settings/ |
| 8 |
|
| 9 |
For the full list of settings and their values, see |
| 10 |
https://docs.djangoproject.com/en/1.9/ref/settings/ |
| 11 |
""" |
| 12 |
|
| 13 |
import os |
| 14 |
import django |
| 15 |
|
| 16 |
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
| 17 |
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
| 18 |
|
| 19 |
|
| 20 |
# Quick-start development settings - unsuitable for production |
| 21 |
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/ |
| 22 |
|
| 23 |
# SECURITY WARNING: keep the secret key used in production secret! |
| 24 |
SECRET_KEY = 'changeme' |
| 25 |
|
| 26 |
# SECURITY WARNING: don't run with debug turned on in production! |
| 27 |
DEBUG = True |
| 28 |
|
| 29 |
ALLOWED_HOSTS = [] |
| 30 |
|
| 31 |
|
| 32 |
# Application definition |
| 33 |
|
| 34 |
INSTALLED_APPS = [ |
| 35 |
'django.contrib.admin', |
| 36 |
'django.contrib.auth', |
| 37 |
'django.contrib.contenttypes', |
| 38 |
'django.contrib.sessions', |
| 39 |
'django.contrib.messages', |
| 40 |
'django.contrib.staticfiles', |
| 41 |
'cas_server', |
| 42 |
] |
| 43 |
|
| 44 |
MIDDLEWARE = [ |
| 45 |
'django.contrib.sessions.middleware.SessionMiddleware', |
| 46 |
'django.middleware.common.CommonMiddleware', |
| 47 |
'django.middleware.csrf.CsrfViewMiddleware', |
| 48 |
'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 49 |
'django.contrib.messages.middleware.MessageMiddleware', |
| 50 |
'django.middleware.clickjacking.XFrameOptionsMiddleware', |
| 51 |
'django.middleware.locale.LocaleMiddleware', |
| 52 |
] |
| 53 |
if django.VERSION < (1, 10): |
| 54 |
MIDDLEWARE_CLASSES = MIDDLEWARE |
| 55 |
|
| 56 |
TEMPLATES = [ |
| 57 |
{ |
| 58 |
'APP_DIRS': True, |
| 59 |
'BACKEND': 'django.template.backends.django.DjangoTemplates', |
| 60 |
'DIRS': [], |
| 61 |
'OPTIONS': { |
| 62 |
'context_processors': [ |
| 63 |
'django.template.context_processors.debug', |
| 64 |
'django.template.context_processors.request', |
| 65 |
'django.contrib.auth.context_processors.auth', |
| 66 |
'django.contrib.messages.context_processors.messages' |
| 67 |
] |
| 68 |
} |
| 69 |
} |
| 70 |
] |
| 71 |
|
| 72 |
ROOT_URLCONF = 'cas_server.tests.urls' |
| 73 |
|
| 74 |
# Database |
| 75 |
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases |
| 76 |
|
| 77 |
DATABASES = { |
| 78 |
'default': { |
| 79 |
'ENGINE': 'django.db.backends.sqlite3', |
| 80 |
'NAME': ':memory:', |
| 81 |
} |
| 82 |
} |
| 83 |
|
| 84 |
# Internationalization |
| 85 |
# https://docs.djangoproject.com/en/1.9/topics/i18n/ |
| 86 |
|
| 87 |
LANGUAGE_CODE = 'en-us' |
| 88 |
|
| 89 |
TIME_ZONE = 'UTC' |
| 90 |
|
| 91 |
USE_I18N = True |
| 92 |
|
| 93 |
if django.VERSION < (4, 0): |
| 94 |
USE_L10N = True |
| 95 |
|
| 96 |
USE_TZ = True |
| 97 |
|
| 98 |
|
| 99 |
# Static files (CSS, JavaScript, Images) |
| 100 |
# https://docs.djangoproject.com/en/1.9/howto/static-files/ |
| 101 |
|
| 102 |
STATIC_URL = '/static/' |
| 103 |
|
| 104 |
CAS_NEW_VERSION_HTML_WARNING = False |
| 105 |
CAS_NEW_VERSION_EMAIL_WARNING = False |
| 106 |
|
| 107 |
LOGGING = { |
| 108 |
'version': 1, |
| 109 |
'disable_existing_loggers': False, |
| 110 |
'formatters': { |
| 111 |
'cas_file': { |
| 112 |
'format': '%(asctime)s %(levelname)s %(message)s' |
| 113 |
}, |
| 114 |
}, |
| 115 |
'handlers': { |
| 116 |
'cas_stream': { |
| 117 |
'level': 'INFO', |
| 118 |
'class': 'logging.StreamHandler', |
| 119 |
'formatter': 'cas_file', |
| 120 |
}, |
| 121 |
}, |
| 122 |
'loggers': { |
| 123 |
'cas_server': { |
| 124 |
'handlers': ['cas_stream'], |
| 125 |
'level': 'INFO', |
| 126 |
'propagate': True, |
| 127 |
}, |
| 128 |
}, |
| 129 |
} |