2013-01-10 19:05:53 +01:00
|
|
|
import os
|
2016-10-06 01:42:24 +02:00
|
|
|
# test_settings.py works differently from
|
|
|
|
# dev_settings.py/prod_settings.py; it actually is directly referenced
|
|
|
|
# by the test suite as DJANGO_SETTINGS_MODULE and imports settings.py
|
|
|
|
# directly and then hacks up the values that are different for the
|
|
|
|
# test suite. As will be explained, this is kinda messy and probably
|
|
|
|
# we'd be better off switching it to work more like dev_settings.py,
|
|
|
|
# but for now, this is what we have.
|
|
|
|
#
|
|
|
|
# An important downside of the test_settings.py approach is that if we
|
|
|
|
# want to change any settings that settings.py then computes
|
|
|
|
# additional settings from (e.g. EXTERNAL_HOST), we need to do a hack
|
|
|
|
# like the below line(s) before we import from settings, for
|
|
|
|
# transmitting the value of EXTERNAL_HOST to dev_settings.py so that
|
|
|
|
# it can be set there, at the right place in the settings.py flow.
|
|
|
|
# Ick.
|
|
|
|
if os.getenv("EXTERNAL_HOST") is None:
|
|
|
|
os.environ["EXTERNAL_HOST"] = "testserver"
|
2012-10-02 17:57:46 +02:00
|
|
|
|
2020-06-08 05:56:03 +02:00
|
|
|
from .settings import * # isort: skip
|
|
|
|
from .test_extra_settings import * # isort: skip
|
2019-08-30 00:21:36 +02:00
|
|
|
|
2020-06-08 05:56:03 +02:00
|
|
|
# Do not add any code after these wildcard imports! Add it to
|
|
|
|
# test_extra_settings instead.
|