"DJANGO_ALLOWED_HOSTS" problem when initializing database
Hi,
I followed the "Debian and Arch Linux installation guide" on Debian Testing, everything is alright. But when I fire the python api/manage.py migrate
command, here's what I get:
Traceback (most recent call last):
File "/srv/funkwhale/virtualenv/lib/python3.6/site-packages/environ/environ.py", line 273, in get_value
value = self.ENVIRON[var]
File "/usr/lib/python3.6/os.py", line 669, in __getitem__
raise KeyError(key) from None
KeyError: 'DJANGO_ALLOWED_HOSTS'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "api/manage.py", line 16, in <module>
django.setup()
File "/srv/funkwhale/virtualenv/lib/python3.6/site-packages/django/__init__.py", line 19, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "/srv/funkwhale/virtualenv/lib/python3.6/site-packages/django/conf/__init__.py", line 56, in __getattr__
self._setup(name)
File "/srv/funkwhale/virtualenv/lib/python3.6/site-packages/django/conf/__init__.py", line 43, in _setup
self._wrapped = Settings(settings_module)
File "/srv/funkwhale/virtualenv/lib/python3.6/site-packages/django/conf/__init__.py", line 106, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/srv/funkwhale/api/config/settings/production.py", line 14, in <module>
from .common import * # noqa
File "/srv/funkwhale/api/config/settings/common.py", line 63, in <module>
ALLOWED_HOSTS = env.list("DJANGO_ALLOWED_HOSTS")
File "/srv/funkwhale/virtualenv/lib/python3.6/site-packages/environ/environ.py", line 179, in list
return self.get_value(var, cast=list if not cast else [cast], default=default)
File "/srv/funkwhale/virtualenv/lib/python3.6/site-packages/environ/environ.py", line 277, in get_value
raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured: Set the DJANGO_ALLOWED_HOSTS environment variable
I filled the .env file with needed infos (hostname, secret key, database and cache URL…) and I've done nothing else. Any clue?
Thanks for your work anyway!