From 717ca578ce8cd95c85f84570b6ccb7a08deb4399 Mon Sep 17 00:00:00 2001 From: Christopher Grebs Date: Wed, 2 Nov 2016 16:56:10 +0100 Subject: [PATCH] Add configured domain to ALLOWED_HOSTS. Fixes circleci tests and our runserver. (#3918) * Add configured domain to ALLOWED_HOSTS. Fixes circleci tests and our runserver. * Correctly map uitests to olympia.dev --- circle.yml | 4 +++- settings.py | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index ad428a83c0..06ceef0b56 100644 --- a/circle.yml +++ b/circle.yml @@ -1,6 +1,8 @@ machine: services: - docker + hosts: + olympia.dev: 127.0.0.1 dependencies: override: @@ -20,7 +22,7 @@ test: - docker-compose run web ./scripts/setup-docker.sh override: - tox -e ui-tests -- - --base-url=http://127.0.0.1 + --base-url=http://olympia.dev --firefox-path=firefox/firefox --junit-xml=$CIRCLE_TEST_REPORTS/junit.xml --html=$CIRCLE_ARTIFACTS/results.html diff --git a/settings.py b/settings.py index e784b2d410..fc6ff58450 100644 --- a/settings.py +++ b/settings.py @@ -6,6 +6,7 @@ won't be tracked in git). """ import os import re +from urlparse import urlparse from olympia.lib.settings_base import * # noqa @@ -71,9 +72,11 @@ ADDONS_LINTER_BIN = os.getenv( ES_DEFAULT_NUM_REPLICAS = 0 SITE_URL = os.environ.get('OLYMPIA_SITE_URL') or 'http://localhost:8000' -SERVICES_DOMAIN = re.sub(r'^https?:\/\/', '', SITE_URL) +SERVICES_DOMAIN = urlparse(SITE_URL).netloc SERVICES_URL = SITE_URL +ALLOWED_HOSTS = ALLOWED_HOSTS + [SERVICES_DOMAIN] + ADDON_COLLECTOR_ID = 1 # Default AMO user id to use for tasks (from users.json fixture in zadmin).