2017-01-18 02:25:12 +01:00
|
|
|
"""
|
|
|
|
Django settings for cqtu project.
|
|
|
|
|
|
|
|
Generated by 'django-admin startproject' using Django 1.10.5.
|
|
|
|
|
|
|
|
For more information on this file, see
|
|
|
|
https://docs.djangoproject.com/en/1.10/topics/settings/
|
|
|
|
|
|
|
|
For the full list of settings and their values, see
|
|
|
|
https://docs.djangoproject.com/en/1.10/ref/settings/
|
|
|
|
"""
|
|
|
|
|
|
|
|
import os
|
2017-01-19 18:42:11 +01:00
|
|
|
from django.contrib.messages import constants as messages
|
|
|
|
|
2017-01-18 02:25:12 +01:00
|
|
|
|
|
|
|
# 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/1.10/howto/deployment/checklist/
|
|
|
|
|
|
|
|
# SECURITY WARNING: keep the secret key used in production secret!
|
|
|
|
SECRET_KEY = 'p9zg)h+n^6_!e7bve9uma+l^j2d-%3pro1#y-19#j1sdi2)*8v'
|
|
|
|
|
|
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
|
|
|
DEBUG = True
|
|
|
|
|
|
|
|
ALLOWED_HOSTS = []
|
|
|
|
|
|
|
|
|
|
|
|
# Application definition
|
|
|
|
|
|
|
|
INSTALLED_APPS = [
|
2020-01-26 11:36:47 +01:00
|
|
|
# default
|
2017-01-18 02:25:12 +01:00
|
|
|
'django.contrib.admin',
|
|
|
|
'django.contrib.auth',
|
|
|
|
'django.contrib.contenttypes',
|
|
|
|
'django.contrib.sessions',
|
|
|
|
'django.contrib.messages',
|
|
|
|
'django.contrib.staticfiles',
|
2020-01-26 11:36:47 +01:00
|
|
|
'crispy_forms',
|
2020-02-02 01:48:10 +01:00
|
|
|
'rest_framework',
|
2020-02-02 02:10:33 +01:00
|
|
|
'django_filters',
|
2017-01-18 02:25:12 +01:00
|
|
|
|
2020-01-26 11:36:47 +01:00
|
|
|
# local
|
|
|
|
'contest',
|
2020-02-02 01:48:10 +01:00
|
|
|
'api',
|
2017-01-18 02:25:12 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
MIDDLEWARE = [
|
|
|
|
'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 = 'cqtu.urls'
|
|
|
|
|
|
|
|
TEMPLATES = [
|
|
|
|
{
|
|
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
|
|
'DIRS': [os.path.join(BASE_DIR, "templates/")],
|
|
|
|
'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',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
WSGI_APPLICATION = 'cqtu.wsgi.application'
|
|
|
|
|
|
|
|
AUTH_USER_MODEL = 'contest.User'
|
|
|
|
LOGIN_REDIRECT_URL = '/'
|
2017-01-19 18:42:11 +01:00
|
|
|
LOGIN_URL = '/login/'
|
2017-01-18 02:25:12 +01:00
|
|
|
|
|
|
|
# Database
|
|
|
|
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
|
|
|
|
|
|
|
|
DATABASES = {
|
|
|
|
'default': {
|
|
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
|
|
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Password validation
|
|
|
|
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
|
|
|
|
|
|
|
|
AUTH_PASSWORD_VALIDATORS = [
|
|
|
|
{
|
|
|
|
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
2018-02-07 23:35:10 +01:00
|
|
|
'OPTIONS': {
|
|
|
|
'min_length': 4,
|
|
|
|
},
|
2017-01-18 02:25:12 +01:00
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
# Internationalization
|
|
|
|
# https://docs.djangoproject.com/en/1.10/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/1.10/howto/static-files/
|
|
|
|
|
|
|
|
STATIC_URL = '/static/'
|
|
|
|
STATIC_ROOT = os.path.join(BASE_DIR, "cstatic")
|
|
|
|
STATICFILES_DIRS = [
|
|
|
|
os.path.join(BASE_DIR, "static"),
|
|
|
|
]
|
|
|
|
|
2017-01-20 23:36:55 +01:00
|
|
|
CRISPY_TEMPLATE_PACK = 'bootstrap3'
|
|
|
|
|
2017-01-19 18:42:11 +01:00
|
|
|
MESSAGE_TAGS = {
|
2020-01-26 11:36:47 +01:00
|
|
|
messages.ERROR: 'danger',
|
2017-01-19 18:42:11 +01:00
|
|
|
}
|
2020-02-02 02:10:33 +01:00
|
|
|
|
|
|
|
REST_FRAMEWORK = {
|
|
|
|
'DEFAULT_FILTER_BACKENDS': ['django_filters.rest_framework.DjangoFilterBackend']
|
|
|
|
}
|