ISO-27001-Risk-Management/config/urls.py
Kevin Heyer bf0a3c22c0 Refactor risk management application with enhanced localization, user authentication, and UI improvements
- Added verbose names for Incident and ResidualRisk models for better clarity in admin interface.
- Updated impact choices for ResidualRisk and Risk models to ensure consistency and clarity.
- Implemented gettext_lazy for translatable strings in models and choices.
- Enhanced the Risk, ResidualRisk, Control, AuditLog, and Incident models with Meta options for better admin representation.
- Added login required decorators to views for improved security.
- Introduced new CSS variables and classes for better visual representation of risk levels.
- Created custom template tags for dynamic CSS class assignment based on risk likelihood and impact.
- Improved dashboard and statistics views with user authentication checks.
- Updated templates for risks, controls, incidents, and admin interface to include edit and delete options for staff users.
- Added new login and logout templates for user authentication.
- Enhanced list views for risks, controls, and incidents to include action buttons for staff users.
- Improved overall UI/UX with Bulma CSS framework for a more modern look and feel.
2025-09-09 14:25:59 +02:00

30 lines
1.1 KiB
Python

from api.views import ping, secure_ping
from django.conf import settings
from django.contrib import admin
from django.urls import path, include
from django.shortcuts import render, redirect
from rest_framework import routers
from risks.views import RiskViewSet, ControlViewSet, ResidualRiskViewSet, UserViewSet, AuditViewSet
router = routers.DefaultRouter()
router.register(r"risks", RiskViewSet)
router.register(r"controls", ControlViewSet)
router.register(r"residual-risks", ResidualRiskViewSet)
router.register(r"users", UserViewSet)
router.register(r"logs", AuditViewSet)
urlpatterns = [
path("admin/", admin.site.urls),
path("i18n/", include("django.conf.urls.i18n")), # Language Switch
path("api/ping/", ping), # Public healthcheck endpoint
path("api/secure-ping/", secure_ping), # Protected API endpoint
path("api/", include(router.urls)),
path("accounts/", include("django.contrib.auth.urls")),
path("", include("risks.urls", namespace="risks")),
]
# Add OIDC routes only if Single Sign-On is enabled
if settings.SSO_ENABLED:
urlpatterns += [
path("oidc/", include("mozilla_django_oidc.urls")),
]