Skip to content

Commit 1e71158

Browse files
committed
Update balancer_backend/urls.py
1 parent 15c3e64 commit 1e71158

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

server/balancer_backend/urls.py

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from django.contrib import admin # Import Django's admin interface module
2+
23
# Import functions for URL routing and including other URL configs
34
from django.urls import path, include, re_path
5+
46
# Import TemplateView for rendering templates
57
from django.views.generic import TemplateView
68
import importlib # Import the importlib module for dynamic module importing
@@ -10,25 +12,37 @@
1012
# Map 'admin/' URL to the Django admin interface
1113
path("admin/", admin.site.urls),
1214
# Include Djoser's URL patterns under 'auth/' for basic auth
13-
path('auth/', include('djoser.urls')),
15+
path("auth/", include("djoser.urls")),
1416
# Include Djoser's JWT auth URL patterns under 'auth/'
15-
path('auth/', include('djoser.urls.jwt')),
17+
path("auth/", include("djoser.urls.jwt")),
1618
# Include Djoser's social auth URL patterns under 'auth/'
17-
path('auth/', include('djoser.social.urls')),
19+
path("auth/", include("djoser.social.urls")),
1820
]
1921

2022
# List of application names for which URL patterns will be dynamically added
21-
urls = ['conversations', 'feedback', 'listMeds', 'risk',
22-
'uploadFile', 'ai_promptStorage', 'ai_settings', 'embeddings', 'medRules', 'text_extraction']
23+
urls = [
24+
"conversations",
25+
"feedback",
26+
"listMeds",
27+
"risk",
28+
"uploadFile",
29+
"ai_promptStorage",
30+
"ai_settings",
31+
"embeddings",
32+
"medRules",
33+
"text_extraction",
34+
"assistants",
35+
]
2336

2437
# Loop through each application name and dynamically import and add its URL patterns
2538
for url in urls:
2639
# Dynamically import the URL module for each app
27-
url_module = importlib.import_module(f'api.views.{url}.urls')
40+
url_module = importlib.import_module(f"api.views.{url}.urls")
2841
# Append the URL patterns from each imported module
29-
urlpatterns += getattr(url_module, 'urlpatterns', [])
42+
urlpatterns += getattr(url_module, "urlpatterns", [])
3043

3144
# Add a catch-all URL pattern for handling SPA (Single Page Application) routing
3245
# Serve 'index.html' for any unmatched URL
3346
urlpatterns += [
34-
re_path(r'^.*$', TemplateView.as_view(template_name='index.html')),]
47+
re_path(r"^.*$", TemplateView.as_view(template_name="index.html")),
48+
]

0 commit comments

Comments
 (0)