pasteque/webtools/settings.py

134 lines
3.8 KiB
Python
Raw Normal View History

2013-04-04 17:37:30 +00:00
import os
import django
### Useful constants
DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__))
SITE_ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
### Customize/configure Pasteque
2020-05-31 15:50:04 +00:00
DISPLAY_NAME = "Pasteque"
2013-04-04 17:37:30 +00:00
COMPRESS_ENABLED = False
2020-05-31 15:50:04 +00:00
SECRET_KEY = "change_me"
ALLOWED_HOSTS = ["localhost", "127.0.0.1"]
TIME_ZONE = "Europe/Brussels"
LANGUAGE_CODE = "fr-FR"
DEBUG = True
2013-04-04 17:37:30 +00:00
TEMPLATE_DEBUG = DEBUG
2020-05-31 15:50:04 +00:00
ADMINS = (("user", "user@hostname.domain"),)
2013-04-04 17:37:30 +00:00
DATABASES = {
2020-05-31 15:50:04 +00:00
"default": {
"ENGINE": "django.db.backends.sqlite3", # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
"NAME": os.path.join(SITE_ROOT, "var", "db", "webtools.sqlite3"),
2013-04-04 17:37:30 +00:00
# The following settings are not used with sqlite3:
2020-05-31 15:50:04 +00:00
"USER": "",
"PASSWORD": "",
"HOST": "", # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
"PORT": "", # Set to empty string for default.
2013-04-04 17:37:30 +00:00
}
}
2023-04-21 07:28:43 +00:00
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
2013-04-04 17:37:30 +00:00
### End of customisation
2020-05-31 15:50:04 +00:00
APP_NAME = "Pasteque"
APP_VERSION = "v0.1"
2013-04-04 17:37:30 +00:00
SITE_ID = 1
MANAGERS = ADMINS
USE_TZ = True
2020-05-31 15:50:04 +00:00
MEDIA_URL = ""
CACHE_PATH = os.path.join(SITE_ROOT, "var", "pygments-static")
COMPRESS_ROOT = os.path.join(SITE_ROOT, "static")
MEDIA_ROOT = os.path.join(SITE_ROOT, "assets")
STATIC_ROOT = os.path.join(SITE_ROOT, "static")
STATIC_URL = "/static/"
2013-04-04 17:37:30 +00:00
STATICFILES_FINDERS = (
2020-05-31 15:50:04 +00:00
"django.contrib.staticfiles.finders.FileSystemFinder",
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
"compressor.finders.CompressorFinder",
2013-04-04 17:37:30 +00:00
)
TEMPLATE_LOADERS = (
2020-05-31 15:50:04 +00:00
"django.template.loaders.filesystem.Loader",
"django.template.loaders.app_directories.Loader",
2013-04-04 17:37:30 +00:00
)
2018-05-06 21:19:49 +00:00
TEMPLATES = [
{
2020-05-31 15:50:04 +00:00
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
"django.template.context_processors.debug",
"django.template.context_processors.request",
"paste.context_processors.app_details",
2018-05-06 21:19:49 +00:00
],
},
},
]
2018-05-11 20:59:16 +00:00
MIDDLEWARE = [
"django.contrib.sessions.middleware.SessionMiddleware",
2020-05-31 15:50:04 +00:00
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
2018-05-11 20:59:16 +00:00
]
2020-05-31 15:50:04 +00:00
ROOT_URLCONF = "webtools.urls"
WSGI_APPLICATION = "webtools.wsgi.application"
2013-04-04 17:37:30 +00:00
INSTALLED_APPS = (
2020-05-31 15:50:04 +00:00
"django.contrib.staticfiles",
"django.contrib.contenttypes",
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.messages",
"django.contrib.sessions",
"compressor",
"paste",
2013-04-04 17:37:30 +00:00
)
2018-05-07 20:52:15 +00:00
PASTE = {
2020-05-31 15:50:04 +00:00
"has_meta_table": False,
"max_characters": 100000,
"default_language": "Python",
2018-05-07 20:52:15 +00:00
}
2013-04-04 17:37:30 +00:00
LOGGING = {
2020-05-31 15:50:04 +00:00
"version": 1,
"disable_existing_loggers": False,
"filters": {"require_debug_false": {"()": "django.utils.log.RequireDebugFalse"}},
"handlers": {
"mail_admins": {
"level": "ERROR",
"filters": ["require_debug_false"],
"class": "django.utils.log.AdminEmailHandler",
2013-04-04 17:37:30 +00:00
},
"console": {
"level": "DEBUG",
"class": "logging.StreamHandler",
},
2020-05-31 15:50:04 +00:00
"logfile": {
"level": "DEBUG",
"class": "logging.handlers.RotatingFileHandler",
"filename": os.path.join(SITE_ROOT, "var", "logs", "error.log"),
"maxBytes": 50000,
"backupCount": 2,
2013-04-04 17:37:30 +00:00
},
},
2020-05-31 15:50:04 +00:00
"loggers": {
"django.request": {
"handlers": ["console", "logfile"],
"level": "ERROR",
"propagate": True,
2013-04-04 17:37:30 +00:00
},
2020-05-31 15:50:04 +00:00
},
2013-04-04 17:37:30 +00:00
}
try:
from local_settings import *
except ImportError:
pass