include template tag not working in django

前端 未结 4 565
执笔经年
执笔经年 2021-02-14 02:03

My Views.py files looks like below

  def homepage(request):
      template = \'homepage.html\'
      list_display_template = \'list.html\'
      list = model.obj         


        
4条回答
  •  感情败类
    2021-02-14 02:14

    I had the same problem,but i will answer this question in a way that other users with a similar problem can understand.

    you probably have a template block of some kind in the included html file, this block either is expecting an include of some kind or is causing an error of which is calling exception that django passes and therefore you are not able to see the error, if you use {% load someLoad %} in the parent template then use it in the included html too, i guess this changes from version to version.

    in my (very specific) case i had this missing in the included html file:

    {% load i18n %} 
    {% load cms_tags sekizai_tags %}
    

提交回复
热议问题