Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add comma separator to INTERNAL_IPS

Adam Bogdałeeb89ec2c4fc
diff --git a/saleor/settings.py b/saleor/settings.py
index c56f9bdad6..816330b68b 100644
--- a/saleor/settings.py
+++ b/saleor/settings.py
@@ -9,6 +9,10 @@ from django.contrib.messages import constants as messages
import django_cache_url
+def get_list(text):
+ return map(str.strip, text.split(','))
+
+
DEBUG = ast.literal_eval(os.environ.get('DEBUG', 'True'))
SITE_ID = 1
@@ -23,7 +27,8 @@ ADMINS = (
# ('Your Name', '[email protected]'),
)
MANAGERS = ADMINS
-INTERNAL_IPS = os.environ.get('INTERNAL_IPS', '127.0.0.1').split()
+
+INTERNAL_IPS = get_list(os.environ.get('INTERNAL_IPS', '127.0.0.1'))
CACHES = {'default': django_cache_url.config()}
@@ -284,8 +289,7 @@ BOOTSTRAP3 = {
TEST_RUNNER = ''
-ALLOWED_HOSTS = map(
- str.strip, os.environ.get('ALLOWED_HOSTS', 'localhost').split(','))
+ALLOWED_HOSTS = get_list(os.environ.get('ALLOWED_HOSTS', 'localhost'))
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')