Django: 'current_tags' is not a valid tag library

前端 未结 17 2793
悲&欢浪女
悲&欢浪女 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:18

    suppose you have the following structure:

    -- Application_Name

    -------templatetags

    --------------init.py

    --------------templates_extras.py

    -------init.py

    -------settings.py

    -- manage.py

    You have to make sure of the following:

    • your application itself inside which your "templatetags" is resident is actually installed in INSTALLED_APPS in settings.py (e.g. "Application_Name")

    • your tag module itself that exists inside "templatetags" is already installed in INSTALLED_APP in settings.py (e.g. "ApplicationName.templatetags.tempaltes_extras")

    • keep sure you have "init.py" under templatetags directory

    • you have to restart the server

    • In some cases you have to remove all generated *.pyc if it did not work then retry again

提交回复
热议问题