Django: how do you serve media / stylesheets and link to them within templates

后端 未结 7 1679
心在旅途
心在旅途 2020-12-07 09:47

Variations of this question have been asked, but I\'m still unable to get my stylesheets to load correctly when my templates are rendered.

I\'m attempting to serve s

7条回答
  •  旧巷少年郎
    2020-12-07 10:11

    Django already has a context process for MEDIA_URL, see Django's documentation.

    It should be availbale by default (unless you've customized CONTEXT_PROCESSORS and forgot to add it) in a RequestContext.

提交回复
热议问题