mirror of
https://github.com/pretix/pretix.git
synced 2026-05-03 14:54:04 +00:00
173 lines
4.2 KiB
Python
173 lines
4.2 KiB
Python
"""
|
|
Django settings for pretix project.
|
|
|
|
For more information on this file, see
|
|
https://docs.djangoproject.com/en/dev/topics/settings/
|
|
|
|
For the full list of settings and their values, see
|
|
https://docs.djangoproject.com/en/dev/ref/settings/
|
|
"""
|
|
|
|
import os
|
|
|
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
|
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
|
|
|
|
|
# Quick-start development settings - unsuitable for production
|
|
# See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/
|
|
|
|
# SECURITY WARNING: keep the secret key used in production secret!
|
|
SECRET_KEY = '0ro^46+8k#dv3ej=oen-2ww)i30#$$^&x&eajyj&_&h)$nc6@5'
|
|
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
|
DEBUG = True
|
|
|
|
TEMPLATE_DEBUG = True
|
|
|
|
ALLOWED_HOSTS = []
|
|
|
|
|
|
# Application definition
|
|
|
|
INSTALLED_APPS = (
|
|
'django.contrib.admin',
|
|
'django.contrib.auth',
|
|
'django.contrib.contenttypes',
|
|
'django.contrib.sessions',
|
|
'django.contrib.messages',
|
|
'django.contrib.staticfiles',
|
|
'pretix.base',
|
|
'pretix.control',
|
|
'pretix.presale',
|
|
'compressor',
|
|
'bootstrap3',
|
|
# 'debug_toolbar.apps.DebugToolbarConfig',
|
|
'djangoformsetjs',
|
|
'pretix.plugins.testdummy',
|
|
'pretix.plugins.timerestriction',
|
|
'pretix.plugins.banktransfer',
|
|
'pretix.plugins.stripe',
|
|
)
|
|
|
|
MIDDLEWARE_CLASSES = (
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
'django.middleware.common.CommonMiddleware',
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
|
|
# 'debug_toolbar.middleware.DebugToolbarMiddleware',
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
'pretix.control.middleware.PermissionMiddleware',
|
|
'pretix.presale.middleware.EventMiddleware',
|
|
'pretix.base.middleware.LocaleMiddleware',
|
|
)
|
|
|
|
TEMPLATE_CONTEXT_PROCESSORS = (
|
|
"django.contrib.auth.context_processors.auth",
|
|
"django.core.context_processors.debug",
|
|
"django.core.context_processors.i18n",
|
|
"django.core.context_processors.media",
|
|
"django.core.context_processors.request",
|
|
"django.core.context_processors.static",
|
|
"django.core.context_processors.tz",
|
|
"django.contrib.messages.context_processors.messages",
|
|
'pretix.control.context.contextprocessor',
|
|
)
|
|
|
|
ROOT_URLCONF = 'pretix.urls'
|
|
|
|
WSGI_APPLICATION = 'pretix.wsgi.application'
|
|
|
|
|
|
# Database
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#databases
|
|
|
|
DATABASES = {
|
|
'default': {
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
|
}
|
|
}
|
|
|
|
# Internationalization
|
|
# https://docs.djangoproject.com/en/dev/topics/i18n/
|
|
|
|
LANGUAGE_CODE = 'en'
|
|
|
|
TIME_ZONE = 'UTC'
|
|
|
|
USE_I18N = True
|
|
|
|
USE_L10N = True
|
|
|
|
USE_TZ = True
|
|
|
|
LOCALE_PATHS = (
|
|
'locale',
|
|
)
|
|
|
|
from django.utils.translation import ugettext_lazy as _ # NOQA
|
|
LANGUAGES = (
|
|
('de', _('German')),
|
|
('en', _('English')),
|
|
)
|
|
|
|
|
|
# Authentication
|
|
|
|
AUTH_USER_MODEL = 'pretixbase.User'
|
|
LOGIN_URL = '/login'
|
|
LOGIN_URL_CONTROL = '/control/login'
|
|
|
|
# Static files (CSS, JavaScript, Images)
|
|
# https://docs.djangoproject.com/en/dev/howto/static-files/
|
|
|
|
STATIC_URL = '/static/'
|
|
|
|
STATIC_ROOT = '_static'
|
|
|
|
STATICFILES_FINDERS = (
|
|
'django.contrib.staticfiles.finders.FileSystemFinder',
|
|
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
|
'compressor.finders.CompressorFinder',
|
|
)
|
|
|
|
COMPRESS_PRECOMPILERS = (
|
|
('text/less', 'pretix.helpers.lessabsolutefilter.LessFilter'),
|
|
)
|
|
|
|
COMPRESS_CSS_FILTERS = (
|
|
'compressor.filters.css_default.CssAbsoluteFilter',
|
|
'compressor.filters.cssmin.CSSMinFilter',
|
|
)
|
|
|
|
# Debug toolbar
|
|
DEBUG_TOOLBAR_PATCH_SETTINGS = False
|
|
DEBUG_TOOLBAR_CONFIG = {
|
|
'JQUERY_URL': ''
|
|
}
|
|
|
|
|
|
# Pretix specific settings
|
|
PRETIX_INSTANCE_NAME = 'pretix.de'
|
|
PRETIX_GLOBAL_REGISTRATION = True
|
|
|
|
DEFAULT_CURRENCY = 'EUR'
|
|
|
|
INTERNAL_IPS = ('127.0.0.1', '::1')
|
|
|
|
from django.contrib.messages import constants as messages # NOQA
|
|
MESSAGE_TAGS = {
|
|
messages.INFO: 'alert-info',
|
|
messages.ERROR: 'alert-danger',
|
|
messages.WARNING: 'alert-warning',
|
|
messages.SUCCESS: 'alert-success',
|
|
}
|
|
|
|
try:
|
|
from local_settings import * # NOQA
|
|
except ImportError:
|
|
pass
|