from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
from rest_framework_simplejwt.views import TokenRefreshView

from interfaces.api.print_views import report_print_view

urlpatterns = [
    path("admin/", admin.site.urls),
    path("api/v1/", include("interfaces.api_v1.urls")),
    path("api/", include("interfaces.api.urls")),
    path("api/auth/refresh/", TokenRefreshView.as_view(), name="token-refresh"),
    path("admin/report/print/", report_print_view, name="report-print"),
]

if settings.DEBUG:  # development only; production serves MEDIA_ROOT from the web server
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
