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-10-02 11:35:39 -04:00
|
|
|
'django.contrib.postgres',
|
2018-08-14 20:12:52 -04:00
|
|
|
'channels',
|
2018-10-02 11:35:39 -04:00
|
|
|
'taggit',
|
2018-09-05 14:13:47 -04:00
|
|
|
'user.apps.UserConfig',
|
2018-08-10 08:39:51 -04:00
|
|
|
'homepage.apps.HomepageConfig',
|
|
|
|
'create_quest.apps.CreateQuestConfig',
|
2018-08-10 19:16:40 -04:00
|
|
|
'quest.apps.QuestConfig',
|
|
|
|
'login.apps.LoginConfig',
|
|
|
|
'signup.apps.SignupConfig',
|
2018-10-02 11:35:39 -04:00
|
|
|
'search.apps.SearchConfig',
|
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',
|
2018-08-30 13:33:08 -04:00
|
|
|
'titivillus.middleware.XRealIPMiddleware',
|
2018-08-10 08:39:51 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
ROOT_URLCONF = 'titivillus.urls'
|
|
|
|
|
|
|
|
TEMPLATES = [
|
|
|
|
{
|
|
|
|
'BACKEND': 'django.template.backends.jinja2.Jinja2',
|
|
|
|
'DIRS': ['jinja2',],
|
|
|
|
'APP_DIRS': True,
|
|
|
|
'OPTIONS': {
|
|
|
|
'environment': 'titivillus.jinja2.environment',
|
|
|
|
'auto_reload': DEBUG,
|
|
|
|
},
|
|
|
|
},
|
2018-08-10 19:16:40 -04:00
|
|
|
{
|
|
|
|
'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',
|
2018-08-10 19:16:40 -04:00
|
|
|
'OPTIONS': {
|
|
|
|
'min_length': 8,
|
|
|
|
}
|
2018-08-10 08:39:51 -04:00
|
|
|
},
|
|
|
|
{
|
2018-09-05 14:13:47 -04:00
|
|
|
'NAME': 'user.validators.MaximumLengthValidator',
|
2018-08-12 14:52:05 -04:00
|
|
|
'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
|
|
|
|
2018-08-12 14:52:05 -04:00
|
|
|
USE_I18N = False
|
2018-08-10 08:39:51 -04:00
|
|
|
|
2018-08-12 14:52:05 -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'),
|
|
|
|
]
|
2018-08-10 19:16:40 -04:00
|
|
|
|
2018-09-05 14:13:47 -04:00
|
|
|
AUTH_USER_MODEL = 'user.User'
|
2018-08-10 19:16:40 -04:00
|
|
|
|
|
|
|
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'
|
2018-08-24 22:54:27 -04:00
|
|
|
CHANNEL_LAYERS = {
|
|
|
|
'default': {
|
|
|
|
'BACKEND': 'channels_redis.core.RedisChannelLayer',
|
|
|
|
'CONFIG': {
|
|
|
|
"hosts": [('127.0.0.1', 6379)],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
2018-09-18 11:45:12 -04:00
|
|
|
|
|
|
|
# Image server url
|
|
|
|
IMG_SVR_URL = "https://img.steelbea.me/"
|
2018-10-02 11:35:39 -04:00
|
|
|
|
|
|
|
# Taggit
|
|
|
|
TAGGIT_CASE_INSENSITIVE = True
|