在settings裏面已經設好MEDIA_URL了
可是一直不知道怎麼在templates中使用
像是

 

 href="{{ MEDIA_URL }}styles/base.css

 

後來看到一篇有說在retrun render_to_response這邊需要修改
改成這樣, 把第三個參數加上context_instance這句

 

return render_to_response('base/index.html', {}, context_instance = 
RequestContext(request))

 

這樣就可以使用了~~

arrow
arrow
    文章標籤
    python django
    全站熱搜

    卡卡 發表在 痞客邦 留言(1) 人氣()