Fix static files!
This commit is contained in:
parent
2a97dab5b6
commit
b93643d0cc
|
@ -168,7 +168,7 @@ class DocumentView(LoginRequiredMixin, View):
|
|||
if not grant:
|
||||
raise PermissionDenied
|
||||
|
||||
return FileResponse(doc.file, content_type="application/pdf")
|
||||
return FileResponse(doc.file, content_type="application/pdf", filename=str(doc) + ".pdf")
|
||||
|
||||
|
||||
class ProfileListView(AdminMixin, SingleTableView):
|
||||
|
|
|
@ -6,4 +6,4 @@ python manage.py compilemessages
|
|||
python manage.py makemigrations
|
||||
python manage.py migrate
|
||||
|
||||
python manage.py runserver 0.0.0.0:8000
|
||||
python manage.py runserver 0.0.0.0:8000 --insecure
|
||||
|
|
|
@ -13,7 +13,9 @@ Including another URLconf
|
|||
1. Import the include() function: from django.urls import include, path
|
||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
import re
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib import admin
|
||||
from django.contrib.staticfiles.views import serve
|
||||
from django.urls import path, include, re_path
|
||||
|
@ -36,7 +38,7 @@ urlpatterns = [
|
|||
|
||||
path('api/', include('api.urls')),
|
||||
|
||||
re_path(r'^static/(?P<path>.*)$', serve),
|
||||
re_path(r'^{prefix}(?P<path>.*)$'.format(prefix=re.escape(settings.STATIC_URL.lstrip('/'))), serve),
|
||||
|
||||
# Supporting old paths
|
||||
path('inscription/', RedirectView.as_view(pattern_name="member:signup")),
|
||||
|
|
Loading…
Reference in New Issue