Commit 6b740a0e authored by Cornee Traas's avatar Cornee Traas
Browse files

disable proxy if ANALYTICS_URL is not defined

parent d591159f
Pipeline #2229 passed with stage
in 1 minute and 5 seconds
......@@ -29,8 +29,9 @@ stages:
runtests:
stage: test
script:
before_script:
- python -V # Print out python version for debugging
- pip install pipenv
- pipenv sync --dev
script:
- pipenv run pytest --cov
\ No newline at end of file
......@@ -25,7 +25,7 @@ PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
SECRET_KEY = os.environ["DJANGO_SECRET_KEY"]
FRONTEND_URL = os.environ.get("FRONTEND_URL", "http://localhost:8080/#/")
ANALYTICS_URL = os.environ.get("ANALYTICS_URL", "http://localhost:8001/api/")
ANALYTICS_URL = os.environ.get("ANALYTICS_URL", None)
if not FRONTEND_URL.endswith("#/"):
FRONTEND_URL += "#/"
......
......@@ -21,6 +21,7 @@ from django.urls import include, path, re_path
import courses.routers
import users.routers
import users.urls
from eit_dashboard.settings import ANALYTICS_URL
from eit_dashboard.views import ApiProxyView
urlpatterns = [
......@@ -29,5 +30,7 @@ urlpatterns = [
path("o/", include((oauth2_provider.urls.base_urlpatterns, "oauth2_provider"))),
path("", include(users.routers)),
path("", include(courses.routers)),
re_path("api/(?P<path>.*)", ApiProxyView),
]
if ANALYTICS_URL is not None: # pragma: no cover
urlpatterns.append(re_path("api/(?P<path>.*)", ApiProxyView))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment