From 5d367f3f490a8acd612d4ea96db475468831c19c Mon Sep 17 00:00:00 2001 From: Rodolphe Breard Date: Fri, 9 Feb 2018 21:45:26 +0100 Subject: [PATCH] Use the Csv helper for the KHAGANAT_HOSTNAMES config --- khaganat/settings.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/khaganat/settings.py b/khaganat/settings.py index 275375e..ac29bdf 100644 --- a/khaganat/settings.py +++ b/khaganat/settings.py @@ -12,7 +12,7 @@ https://docs.djangoproject.com/en/2.0/ref/settings/ from django.utils.translation import gettext_lazy as _ from django.urls import reverse_lazy -from decouple import config +from decouple import config, Csv import os @@ -29,10 +29,7 @@ SECRET_KEY = config('KHAGANAT_SECRET_KEY') # SECURITY WARNING: don't run with debug turned on in production! DEBUG = config('KHAGANAT_DEBUG', default=False, cast=bool) -ALLOWED_HOSTS = [ - _ for _ in config('KHAGANAT_HOSTNAMES', default='').split(',') - if _ != '' -] +ALLOWED_HOSTS = config('KHAGANAT_HOSTNAMES', default='', cast=Csv()) # Application definition