Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit e6235e5

Browse files
authored
Merge pull request #153 from edx/thallada/allowed-hosts
Add "analyticsapi" to local ALLOWED_HOSTS setting
2 parents b38ecd3 + 1818db4 commit e6235e5

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

analytics_data_api/management/commands/generate_fake_course_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def add_arguments(self, parser):
4848
'--course_id',
4949
action='store',
5050
dest='course_id',
51-
default='course-v1:edX+DemoX+Demo_Courset',
51+
default='course-v1:edX+DemoX+Demo_Course',
5252
help='Course ID for which to generate fake data',
5353
)
5454
parser.add_argument(

analyticsdataserver/settings/local.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,11 @@
6767
LMS_BASE_URL = 'http://localhost:8000/' # the base URL for your running local LMS instance
6868
COURSE_BLOCK_API_AUTH_TOKEN = 'paste auth token here' # see README for instructions on how to configure this value
6969

70+
# In Insights, we run this API as a separate service called "analyticsapi" to run acceptance/integration tests. Docker
71+
# saves the service name as a host in the Insights container so it can reach the API by requesting http://analyticsapi/.
72+
# However, in Django 1.10.3, the HTTP_HOST header of requests started to be checked against the ALLOWED_HOSTS setting
73+
# even in DEBUG=True mode. Here, we add the Docker service name "analyticsapi" to the default set of local allowed
74+
# hosts.
75+
ALLOWED_HOSTS = ['localhost', '127.0.0.1', '::1', 'analyticsapi']
76+
7077
########## END ANALYTICS DATA API CONFIGURATION

0 commit comments

Comments
 (0)