How to return static files passing through a view in django?

前端 未结 8 1802
名媛妹妹
名媛妹妹 2020-12-09 09:04

I need to return css files and js files according to specific logic. Clearly, static serve does not perform what I need. I have a view, whose render method uses logic to fin

8条回答
  •  伪装坚强ぢ
    2020-12-09 09:56

    It should be wasteful to use django to serve static content (not to mention, several orders of magnitude slower).

    I'd rather convert the view into a context processor and use the variables in templates to find what blocks to include.

提交回复
热议问题