mirror of
https://github.com/quantum5/qlinks.git
synced 2025-04-24 10:41:57 -04:00
95 lines
2.7 KiB
Python
95 lines
2.7 KiB
Python
from datetime import timedelta
|
|
from pathlib import Path
|
|
|
|
BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
|
|
|
INSTALLED_APPS = [
|
|
'django.contrib.admin',
|
|
'django.contrib.auth',
|
|
'django.contrib.contenttypes',
|
|
'django.contrib.sessions',
|
|
'django.contrib.messages',
|
|
'django.contrib.staticfiles',
|
|
'django_hosts',
|
|
'qlinks',
|
|
]
|
|
|
|
MIDDLEWARE = [
|
|
'django_hosts.middleware.HostsRequestMiddleware',
|
|
'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',
|
|
'django_hosts.middleware.HostsResponseMiddleware',
|
|
]
|
|
|
|
ROOT_URLCONF = 'qlinks.urls'
|
|
ROOT_HOSTCONF = 'qlinks.hosts'
|
|
DEFAULT_HOST = 'shortener'
|
|
WSGI_APPLICATION = 'qlinks.project.wsgi.application'
|
|
|
|
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',
|
|
],
|
|
},
|
|
},
|
|
]
|
|
|
|
AUTH_PASSWORD_VALIDATORS = [
|
|
{
|
|
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
|
},
|
|
{
|
|
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
|
},
|
|
{
|
|
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
|
},
|
|
{
|
|
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
|
},
|
|
]
|
|
|
|
|
|
# Internationalization
|
|
# https://docs.djangoproject.com/en/4.0/topics/i18n/
|
|
LANGUAGE_CODE = 'en-us'
|
|
TIME_ZONE = 'UTC'
|
|
USE_I18N = True
|
|
USE_TZ = True
|
|
|
|
|
|
# Static files (CSS, JavaScript, Images)
|
|
# https://docs.djangoproject.com/en/4.0/howto/static-files/
|
|
STATIC_URL = 'static/'
|
|
|
|
|
|
# Default primary key field type
|
|
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
|
|
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
|
|
|
|
|
# Default qlinks config
|
|
QLINKS_ADMIN_HOST = r'admin'
|
|
QLINKS_CANONICAL = None
|
|
QLINKS_SITE_HEADER = 'QLinks Admin'
|
|
QLINKS_SITE_TITLE = 'QLinks Admin'
|
|
QLINKS_INDEX_TITLE = 'Welcome to the QLinks admin interface!'
|
|
QLINKS_CDN_CACHE = None
|
|
QLINKS_CHECK_MIN = timedelta(days=6)
|
|
QLINKS_CHECK_MAX = timedelta(days=8)
|
|
QLINKS_CHECK_THROTTLE = 1
|
|
QLINKS_BROKEN_EMAIL = False
|