【问题标题】:django-compressor: Invalid templatedjango-compressor:模板无效
【发布时间】:2014-01-23 18:14:46
【问题描述】:

我正在为一个项目使用 django-compressor,但是当我运行 ./manage compress 命令时,我得到了一个错误列表,例如:

Invalid template /home/somepath: 'some_template_tags' is not a valid tag library: ImportError raised loading postman.templatetags.some_template_tags: cannot import name SomeLibrary

我没有任何额外的信息。此外,应用程序被添加到INSTALLED_APPS 并且模板标签在没有 django-compressor 的情况下正常运行。

更新:

这是settings.py文件:

INSTALLED_APPS = (
     'django.contrib.staticfiles',
     'cms',
     'mptt',
     'menus',
     'south',
     'sekizai',
     'classytags',
     'postman',
     # More apps
     'compressor',
)
# More lines
STATICFILES_FINDERS = (
     'django.contrib.staticfiles.finders.FileSystemFinder',
     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
     'compressor.finders.CompressorFinder',
)

【问题讨论】:

  • 您能否更新您的帖子以在您的项目 settings.py 文件中包含相关信息?

标签: django django-compressor


【解决方案1】:

问题是邮递员。我在 postman/models.py 文件中将函数:get_user_model() 替换为 User

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-02-09
    • 2011-12-06
    • 2015-04-05
    • 1970-01-01
    • 2020-10-21
    • 1970-01-01
    • 2011-07-15
    • 2021-02-23
    相关资源
    最近更新 更多