How do I serve CSS to Django in development?

后端 未结 4 1421
心在旅途
心在旅途 2021-02-02 03:37

I\'ve been all through the documentation, and it just doesn\'t make sense to me. I ran collectstatic, I set up /static/ directories in both my app and my project directories, I

4条回答
  •  余生分开走
    2021-02-02 04:25

    I have the same problem, and search many answers, but no one give me right answer. The problem is you don't use RequestContext I think. You should make a RequestContext as the parameter of Template like

    c = RequestContext(request, {
        'foo': 'bar',
    })
    

    In my views is:

    return render_to_response('parts/test2.html', RequestContext(request, locals()))
    

提交回复
热议问题