From 69f6a16cceb29ee716d29cd2cfd460581b05b2c9 Mon Sep 17 00:00:00 2001 From: Daoud Clarke Date: Sun, 19 Nov 2023 10:00:31 +0000 Subject: [PATCH 1/3] 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), ] From 56ee43e7301b28ad634715a6df27e3b7a34bbb35 Mon Sep 17 00:00:00 2001 From: Daoud Clarke Date: Sun, 19 Nov 2023 10:01:04 +0000 Subject: [PATCH 2/3] Remove unused settings --- mwmbl/settings_common.py | 2 -- mwmbl/urls.py | 2 -- 2 files changed, 4 deletions(-) diff --git a/mwmbl/settings_common.py b/mwmbl/settings_common.py index a1d451f..93cbba7 100644 --- a/mwmbl/settings_common.py +++ b/mwmbl/settings_common.py @@ -164,5 +164,3 @@ 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 03f86b5..dae8570 100644 --- a/mwmbl/urls.py +++ b/mwmbl/urls.py @@ -16,12 +16,10 @@ 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, api_original from mwmbl.views import home_fragment, fetch_url, index - urlpatterns = [ path('admin/', admin.site.urls), path('api/v1/', api_v1.urls), From da787a67db69d34deb42c526eb59791a37444d8c Mon Sep 17 00:00:00 2001 From: Daoud Clarke Date: Sun, 19 Nov 2023 10:01:48 +0000 Subject: [PATCH 3/3] Unused setting --- mwmbl/settings_common.py | 1 - 1 file changed, 1 deletion(-) diff --git a/mwmbl/settings_common.py b/mwmbl/settings_common.py index 93cbba7..ca01872 100644 --- a/mwmbl/settings_common.py +++ b/mwmbl/settings_common.py @@ -9,7 +9,6 @@ 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'.