问题描述
我正在尝试使用 django-compressor 2.4.1 在 heroku 上部署 Django 3.2.4 应用程序。我想让 heroku 压缩文件,所以我忽略了我的本地压缩目录并添加了一个编译后文件,如指定的 here。 这是构建日志
Compressing static files
Traceback (most recent call last):
File "/app/.heroku/python/lib/python3.9/site-packages/django/template/utils.py",line 66,in __getitem__
return self._engines[alias]
KeyError: 'django'
During handling of the above exception,another exception occurred:
... other stuff
File "/app/.heroku/python/lib/python3.9/site-packages/django/template/backends/django.py",line 123,in get_package_libraries
raise InvalidTemplateLibrary(
django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'compressor.templatetags.private_static': cannot import name 'PrivateFileSystemFinder' from 'compressor.finders' (/app/.heroku/python/lib/python3.9/site-packages/compressor/finders.py)
! Push rejected,Failed to compile Python app.
! Push Failed
我按照 docs 中的步骤设置了 django-compressor。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)