-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathurls.py
28 lines (23 loc) · 894 Bytes
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""URL configuration."""
from django.apps import apps
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
from apps.core.api.routers import api_router
urlpatterns = [
path("", include("apps.core.urls"), name="core"),
path("admin/", admin.site.urls, name="admin"),
path("api/", include(api_router.urls), name="api"),
path("i18n/", include("django.conf.urls.i18n"), name="i18n"),
]
# Include URLs for apps named starting with "apps." which have models.
for app in apps.get_app_configs():
if app.models_module and app.name.startswith("apps."):
urlpatterns.append(
path(f"{app.label}/", include(f"{app.name}.urls"), name=app.label)
)
if settings.DEBUG:
urlpatterns += static(
settings.STATIC_URL, document_root=settings.STATIC_ROOT
)