django dev server, adding headers to static files

前端 未结 2 1108
[愿得一人]
[愿得一人] 2021-01-02 04:30

Using the django dev server (1.7.4), I want to add some headers to all the static files it serves.

It looks like I can pass a custom view to django.conf.urls.s

2条回答
  •  天命终不由人
    2021-01-02 05:08

    staticfiles app overrides the core runserver command but allows you to disable the automatic serving of the static files:

    python manage.py runserver --nostatic
    

提交回复
热议问题