From 69f6a16cceb29ee716d29cd2cfd460581b05b2c9 Mon Sep 17 00:00:00 2001 From: Daoud Clarke Date: Sun, 19 Nov 2023 10:00:31 +0000 Subject: [PATCH] Reinstate old API --- mwmbl/settings_common.py | 4 +++- mwmbl/urls.py | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/mwmbl/settings_common.py b/mwmbl/settings_common.py index c0a7436..a1d451f 100644 --- a/mwmbl/settings_common.py +++ b/mwmbl/settings_common.py @@ -9,7 +9,7 @@ https://docs.djangoproject.com/en/4.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/4.2/ref/settings/ """ - +import os from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. @@ -164,3 +164,5 @@ FOOTER_LINKS = [ ] + +ENABLE_OLD_API = os.getenv("MWMBL_ENABLE_OLD_API", "false").lower() == "true" diff --git a/mwmbl/urls.py b/mwmbl/urls.py index 776361a..03f86b5 100644 --- a/mwmbl/urls.py +++ b/mwmbl/urls.py @@ -16,16 +16,19 @@ Including another URLconf """ from django.contrib import admin from django.urls import path, include +from django.conf import settings -from mwmbl.api import api_v1 +from mwmbl.api import api_v1, api_original from mwmbl.views import home_fragment, fetch_url, index + urlpatterns = [ path('admin/', admin.site.urls), path('api/v1/', api_v1.urls), path('accounts/', include('allauth.urls')), - path('', index, name="home"), + path('', index, name="index"), path('app/home/', home_fragment, name="home"), - path('app/fetch/', fetch_url, name="fetch_url") + path('app/fetch/', fetch_url, name="fetch_url"), + path('', api_original.urls), ]