test_settings.py was setting EXTERNAL_HOST after importing settings.py, which has several variables (like SERVER_URI) that are computed from EXTERNAL_HOST. [tweaked by tabbott to add comments explaining the story here].