Titivillus/titivillus/settings.py

150 lines
3.4 KiB
Python
Raw Normal View History

2018-08-10 08:39:51 -04:00
#!/usr/bin/env python3
"""
Django settings for titivillus project.
"""
import os
import titivillus.settings_secret
# 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.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = titivillus.settings_secret.SECRET_KEY
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['steelbea.me']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
2018-08-14 20:12:52 -04:00
'channels',
'users.apps.UsersConfig',
2018-08-10 08:39:51 -04:00
'homepage.apps.HomepageConfig',
'create_quest.apps.CreateQuestConfig',
'quest.apps.QuestConfig',
'login.apps.LoginConfig',
'signup.apps.SignupConfig',
2018-08-10 08:39:51 -04: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 = 'titivillus.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.jinja2.Jinja2',
'DIRS': ['jinja2',],
'APP_DIRS': True,
'OPTIONS': {
'environment': 'titivillus.jinja2.environment',
'auto_reload': DEBUG,
},
},
{
'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',
],
},
},
2018-08-10 08:39:51 -04:00
]
WSGI_APPLICATION = 'titivillus.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'titivillus',
'USER': 'titivillus',
'PASSWORD': titivillus.settings_secret.DB_KEY,
'HOST': '',
'PORT': '',
}
}
# Password validation
# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
'OPTIONS': {
'min_length': 8,
}
2018-08-10 08:39:51 -04:00
},
{
'NAME': 'users.validators.MaximumLengthValidator',
'OPTIONS': {
'max_length': 1024,
}
}
2018-08-10 08:39:51 -04:00
]
# Internationalization
# https://docs.djangoproject.com/en/2.0/topics/i18n/
LANGUAGE_CODE = 'en-us'
2018-08-21 09:01:16 -04:00
TIME_ZONE = 'America/New_York'
2018-08-10 08:39:51 -04:00
USE_I18N = False
2018-08-10 08:39:51 -04:00
USE_L10N = False
2018-08-10 08:39:51 -04:00
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = '/usr/local/www/html/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static'),
]
AUTH_USER_MODEL = 'users.User'
PASSWORD_HASHERS = [
'django.contrib.auth.hashers.Argon2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
]
2018-08-14 20:12:52 -04:00
ASGI_APPLICATION = 'titivillus.routing.application'