From e487dad0264fc5c555a981f7773684a9556fcaf6 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Fri, 5 Jul 2019 21:25:31 +0200 Subject: [PATCH] Improve settings The commit removes the non-existing sys.path import, simplifies the condition in the show_debug_toolbar function and defines ALLOWED_HOSTS for the test environment. --- gnuviechadmin/gnuviechadmin/settings.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gnuviechadmin/gnuviechadmin/settings.py b/gnuviechadmin/gnuviechadmin/settings.py index 26b5b9d..b6cc710 100644 --- a/gnuviechadmin/gnuviechadmin/settings.py +++ b/gnuviechadmin/gnuviechadmin/settings.py @@ -6,7 +6,6 @@ Common settings and globals. """ from os.path import abspath, basename, dirname, join, normpath -from sys import path from django.contrib.messages import constants as messages @@ -23,9 +22,6 @@ SITE_ROOT = dirname(DJANGO_ROOT) # Site name: SITE_NAME = basename(DJANGO_ROOT) -# Add our project to our pythonpath, this way we don't need to type our project -# name in our dotted import paths: -path.append(DJANGO_ROOT) # ######### END PATH CONFIGURATION @@ -363,7 +359,7 @@ STATIC_ROOT = "/srv/gnuviechadmin/static/" def show_debug_toolbar(request): - return DEBUG == True and GVA_ENVIRONMENT == "local" + return DEBUG and GVA_ENVIRONMENT == "local" if GVA_ENVIRONMENT == "local": @@ -431,6 +427,7 @@ if GVA_ENVIRONMENT == "local": # ######### END TOOLBAR CONFIGURATION elif GVA_ENVIRONMENT == "test": + ALLOWED_HOSTS = ["localhost"] PASSWORD_HASHERS = ("django.contrib.auth.hashers.MD5PasswordHasher",) LOGGING["handlers"].update( {