diff options
author | Luke Shumaker <lukeshu@parabola.nu> | 2019-03-23 20:05:34 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@parabola.nu> | 2019-03-23 20:05:34 -0400 |
commit | 87bd4a32b2eb983a34bf28eaee6e2c6ce5a405ee (patch) | |
tree | f8686805323e4c71c582480aaa64203415240a03 /settings.py | |
parent | 7f68a8f0f79ac1548aaece3ebd65a296714163a6 (diff) | |
parent | a526410f2a5be83c0b853bb4e7624c77997ccd61 (diff) |
Merge branch 'archweb-generic' into lukeshu/master
Diffstat (limited to 'settings.py')
-rw-r--r-- | settings.py | 74 |
1 files changed, 42 insertions, 32 deletions
diff --git a/settings.py b/settings.py index 57454f15..12148766 100644 --- a/settings.py +++ b/settings.py @@ -3,7 +3,6 @@ import os ## Set the debug values DEBUG = False -TEMPLATE_DEBUG = DEBUG DEBUG_TOOLBAR = False ## Notification admins @@ -45,28 +44,26 @@ LOGIN_REDIRECT_URL = '/' # Set django's User stuff to use our profile model AUTH_PROFILE_MODULE = 'devel.UserProfile' -# We add a processor to determine if the request is secure or not -TEMPLATE_CONTEXT_PROCESSORS = ( - 'django.contrib.auth.context_processors.auth', - 'django.core.context_processors.debug', - 'django.contrib.messages.context_processors.messages', - 'main.context_processors.secure', - 'main.context_processors.branding', -) - -TEMPLATE_DIRS = ( - # Put strings here, like "/home/html/django_templates". - # Always use forward slashes, even on Windows. - '%s/templates' % DEPLOY_PATH, -) - -TEMPLATE_LOADERS = ( - 'django_jinja.loaders.FileSystemLoader', - 'django_jinja.loaders.AppLoader', -) - -# Send templates matching the following to the Jinja2 engine -DEFAULT_JINJA2_TEMPLATE_EXTENSION = '.jinja' +from os import path +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [ + path.join(DEPLOY_PATH, 'templates') + ], + 'APP_DIRS': True, + 'OPTIONS': { + 'debug': DEBUG, + 'context_processors': [ + 'django.contrib.auth.context_processors.auth', + 'django.core.context_processors.debug', + 'django.contrib.messages.context_processors.messages', + 'main.context_processors.secure', + 'main.context_processors.branding', + ], + } + } +] MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', @@ -118,7 +115,6 @@ INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.staticfiles', 'django_countries', - 'django_jinja', 'main', 'mirrors', @@ -160,6 +156,9 @@ LOGGING = { PGP_SERVER = 'pgp.mit.edu' PGP_SERVER_SECURE = True +# URL where archweb is deployed +WEB_URL = 'https://www.archlinux.org' + # URL to fetch a current list of available ISOs ISO_LIST_URL = 'https://repo.parabola.nu/iso/' @@ -169,6 +168,11 @@ ISO_LIST_URL = 'https://repo.parabola.nu/iso/' # URL for linking to mailing lists MAILMAN_BASE_URL = 'https://lists.parabola.nu/' +# Domain for mailman mailing lists +MAILMAN_DOMAIN = 'lists.parabola.nu' + +# Email news items to NEWS_MAILINGLIST@MAILMAN_DOMAIN +NEWS_MAILINGLIST = 'dev' # URL for linking to the bugtracker BUGTRACKER_URL = 'https://labs.parabola.nu/' @@ -202,15 +206,21 @@ COUNTRIES_OVERRIDE = { 'US': 'United States', } +# Make this unique, and don't share it with anybody. +SECRET_KEY = '00000000000000000000000000000000000000000000000' + +DATABASES = { + 'default': { + 'ENGINE' : 'django.db.backends.sqlite3', + 'NAME' : 'database.db', + }, +} + ## Import local settings -from local_settings import * - -# Enable caching templates in production environments -if not TEMPLATE_DEBUG: - TEMPLATE_LOADERS = ( - ('django.template.loaders.cached.Loader', TEMPLATE_LOADERS), - ) - JINJA2_BYTECODE_CACHE_ENABLE = True +try: + from local_settings import * +except ImportError: + pass # Enable the debug toolbar if requested if DEBUG_TOOLBAR: |