2024-01-06 12:27:41 +08:00
|
|
|
from django.conf.urls.static import static
|
|
|
|
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
2024-01-06 12:13:39 +08:00
|
|
|
from django.urls import path, include
|
2024-10-30 22:09:58 +08:00
|
|
|
from drf_spectacular.views import (
|
|
|
|
SpectacularAPIView,
|
|
|
|
SpectacularRedocView,
|
|
|
|
SpectacularSwaggerView,
|
|
|
|
)
|
2024-09-25 19:27:02 +08:00
|
|
|
from django.contrib import admin
|
2024-08-30 15:46:30 +08:00
|
|
|
from config.settings import DEBUG, SERVE_MEDIA, MEDIA_ROOT
|
2024-10-30 22:09:58 +08:00
|
|
|
|
2024-01-06 12:13:39 +08:00
|
|
|
urlpatterns = [
|
2024-10-30 22:09:58 +08:00
|
|
|
path("accounts/", include("accounts.urls")),
|
|
|
|
path("subscriptions/", include("subscriptions.urls")),
|
|
|
|
path("notifications/", include("notifications.urls")),
|
|
|
|
path("billing/", include("billing.urls")),
|
|
|
|
path("stripe/", include("payments.urls")),
|
|
|
|
path("admin/", admin.site.urls),
|
|
|
|
path("schema/", SpectacularAPIView.as_view(), name="schema"),
|
|
|
|
path(
|
|
|
|
"swagger/", SpectacularSwaggerView.as_view(url_name="schema"), name="swagger-ui"
|
|
|
|
),
|
|
|
|
path("redoc/", SpectacularRedocView.as_view(url_name="schema"), name="redoc"),
|
2024-01-06 12:13:39 +08:00
|
|
|
]
|
|
|
|
|
2024-05-10 23:15:29 +08:00
|
|
|
# URLs for local development
|
2024-08-30 15:46:30 +08:00
|
|
|
if DEBUG and SERVE_MEDIA:
|
2024-01-06 12:13:39 +08:00
|
|
|
urlpatterns += staticfiles_urlpatterns()
|
2024-10-30 22:09:58 +08:00
|
|
|
urlpatterns += static("media/", document_root=MEDIA_ROOT)
|
2024-09-25 19:27:02 +08:00
|
|
|
if DEBUG:
|
2024-10-30 22:09:58 +08:00
|
|
|
urlpatterns += [path("silk/", include("silk.urls", namespace="silk"))]
|