Django: 'current_tags' is not a valid tag library

前端 未结 17 2794
悲&欢浪女
悲&欢浪女 2020-12-23 18:41

I have a small Django project I received from a friend. The code works perfectly on his system. However, on my system I get the following error message when running the serv

17条回答
  •  Happy的楠姐
    2020-12-23 19:17

    Make sure the load statement is correct. It should be the name of the file, not the name of the app. For instance, if you have this app:

    appname
    ├── __init__.py
    ├── templatetags
    │   ├── __init__.py
    │   └── foobarfilename.py
    

    Then you should put this in your template:

    {% load foobarfilename %}
    

    Of course, you should check the other answers too.

提交回复
热议问题