from __future__ import annotations from django.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.contrib.auth import views as auth_views from django.templatetags.static import static as static_url from django.urls import include, path from django.views.generic import RedirectView from apps.core.views import ( SecurityAwareLoginView, demo_login, entra_callback, entra_login, ) urlpatterns = [ path( "favicon.ico", RedirectView.as_view(url=static_url("favicon.svg"), permanent=True), name="favicon", ), path("admin/", admin.site.urls), path( "login/", SecurityAwareLoginView.as_view(), name="login", ), path("logout/", auth_views.LogoutView.as_view(), name="logout"), # Wachtwoordherstel (Django's ingebouwde flow, eigen templates). path( "wachtwoord/herstellen/", auth_views.PasswordResetView.as_view(), name="password_reset", ), path( "wachtwoord/herstellen/verzonden/", auth_views.PasswordResetDoneView.as_view(), name="password_reset_done", ), path( "wachtwoord/herstellen///", auth_views.PasswordResetConfirmView.as_view(), name="password_reset_confirm", ), path( "wachtwoord/herstellen/klaar/", auth_views.PasswordResetCompleteView.as_view(), name="password_reset_complete", ), # Entra ID SSO en demo-toegang. path("auth/entra/login/", entra_login, name="entra-login"), path("auth/entra/callback/", entra_callback, name="entra-callback"), path("auth/demo/", demo_login, name="demo-login"), path("", include(("apps.core.urls", "dashboard"), namespace="dashboard")), path("jobs/", include(("apps.jobs.urls", "jobs"), namespace="jobs")), path("profiles/", include(("apps.profiles.urls", "profiles"), namespace="profiles")), path("sources/", include(("apps.sources.urls", "sources"), namespace="sources")), ] if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)