diff --git a/common/urls.py b/common/urls.py index c1b16a5..504fe21 100644 --- a/common/urls.py +++ b/common/urls.py @@ -1,6 +1,10 @@ +import os + +from django.conf import settings from django.contrib import admin from django.urls import include, path, re_path from django.views.generic import RedirectView +from django.views.static import serve from candidats import views as candidats_views from stages import views @@ -50,4 +54,9 @@ urlpatterns = [ name='send-student-reports'), path('availability//summary/', views.AvailabilitySummaryView.as_view()), path('corporation//contacts/', views.CorpContactJSONView.as_view()), + + # Serve bulletins by Django to allow LoginRequiredMiddleware to apply + path('media/bulletins/', serve, + {'document_root': os.path.join(settings.MEDIA_ROOT, 'bulletins'), 'show_indexes': False} + ), ]