1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-21 11:18:23 +02:00

Better photo authorization upload

This commit is contained in:
Yohann D'ANELLO
2020-09-27 12:36:37 +02:00
parent c84d4151bb
commit 9ef35217d3
7 changed files with 79 additions and 40 deletions

View File

@ -18,8 +18,7 @@ from django.contrib import admin
from django.urls import path, include
from django.views.defaults import bad_request, permission_denied, page_not_found, server_error
from django.views.generic import TemplateView
from corres2math import settings
from registration.views import PhotoAuthorizationView
urlpatterns = [
path('', TemplateView.as_view(template_name="index.html"), name='index'),
@ -32,12 +31,11 @@ urlpatterns = [
path('participation/', include('participation.urls')),
path('registration/', include('registration.urls')),
path('media/authorization/photo/<str:filename>/', PhotoAuthorizationView.as_view(), name='photo_authorization'),
path('', include('eastereggs.urls')),
]
# FIXME Protect files
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
handler400 = bad_request
handler403 = permission_denied
handler404 = page_not_found