Skip to content

armgit / mwmbl

Public Imported from GitHub
0

An open source, non-profit web search engine

Reinstate old API

Daoud Clarke69f6a16cceb2
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),
]