25 lines
772 B
Python
25 lines
772 B
Python
from django.conf import settings
|
|
from django.conf.urls.static import static
|
|
from django.contrib import admin
|
|
from django.urls import include, path
|
|
|
|
urlpatterns = [
|
|
path("admin/", admin.site.urls),
|
|
path("api/", include("core.urls")),
|
|
path("api/auth/", include("users.urls")),
|
|
path("api/locations/", include("locations.urls")),
|
|
]
|
|
|
|
if settings.DEBUG:
|
|
from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView
|
|
|
|
urlpatterns += [
|
|
path("api/schema/", SpectacularAPIView.as_view(), name="schema"),
|
|
path(
|
|
"api/docs/",
|
|
SpectacularSwaggerView.as_view(url_name="schema"),
|
|
name="swagger-ui",
|
|
),
|
|
]
|
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|