Skip to content

Commit aa3275c

Browse files
committed
Updated: for django and react urls
1 parent 440eb9b commit aa3275c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/backend/urls.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from django.contrib import admin
1818
from django.urls import path, re_path
1919

20+
from backend.env import config
2021
from api.views import HomeView, HelloAPIView, AboutView, DateAPIView
2122

2223
djangourlpatterns = [
@@ -32,4 +33,9 @@
3233
re_path(r"^about/$", HomeView.as_view(), name="about"),
3334
]
3435

35-
urlpatterns = djangourlpatterns + reacturlpatterns
36+
DJANGO_IN_REACT = config("DJANGO_IN_REACT", default=True, cast=bool)
37+
38+
if DJANGO_IN_REACT:
39+
urlpatterns = djangourlpatterns + reacturlpatterns
40+
else:
41+
urlpatterns = djangourlpatterns

0 commit comments

Comments
 (0)