- Add django-otp and qrcode dependencies - Create comprehensive 2FA views and templates in German - Add 2FA setup, verification, and management interfaces - Implement backup token system with 10 recovery codes - Add TwoFactorMiddleware for session enforcement - Integrate 2FA controls into user navigation menu - Support QR code generation for authenticator apps - Add forms for secure 2FA operations with validation - Configure OTP settings and admin site integration Features: - Optional 2FA (users can enable/disable) - TOTP compatible with Google Authenticator, Authy, etc. - Backup codes for emergency access - German language interface - Session-based 2FA enforcement - Password confirmation for sensitive operations - Production-ready with HTTPS support
24 lines
661 B
Python
24 lines
661 B
Python
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.urls import include, path
|
|
|
|
from stiftung.views import home
|
|
|
|
urlpatterns = [
|
|
path("", include("stiftung.urls")),
|
|
path("admin/", admin.site.urls),
|
|
# Authentication URLs
|
|
path(
|
|
"login/",
|
|
auth_views.LoginView.as_view(template_name="registration/login.html"),
|
|
name="login",
|
|
),
|
|
path("logout/", auth_views.LogoutView.as_view(), name="logout"),
|
|
|
|
]
|
|
|
|
if settings.DEBUG:
|
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|