gpt4 book ai didi

Django-pipeline 'compressed' 不是有效的标签库 : ImportError raised loading pipeline. templatetags.compressed:没有名为 conf 的模块

转载 作者:行者123 更新时间:2023-12-02 11:37:57 26 4
gpt4 key购买 nike

我收到此错误,但我不知道为什么突然遇到 django-pipeline 问题。

我正在 virtualenv 下运行该项目,我尝试使用所需的基本应用程序创建一个新项目,看看它是否可以修复它,但我总是收到此错误:

TemplateSyntaxError at /
'compressed' is not a valid tag library: ImportError raised loading pipeline.templatetags.compressed: No module named conf
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.7.3
Exception Type: TemplateSyntaxError
Exception Value:
'compressed' is not a valid tag library: ImportError raised loading pipeline.templatetags.compressed: No module named conf
Exception Location: /home/ymorin007/.virtualenvs/humor15b/local/lib/python2.7/site-packages/django/template/defaulttags.py in load, line 1119
Python Executable: /home/ymorin007/.virtualenvs/humor15b/bin/python
Python Version: 2.7.6
Python Path:
['/home/ymorin007/workspace/sites/humor15.com/src',
'/home/ymorin007/.virtualenvs/humor15b/lib/python2.7',
'/home/ymorin007/.virtualenvs/humor15b/lib/python2.7/plat-x86_64-linux-gnu',
'/home/ymorin007/.virtualenvs/humor15b/lib/python2.7/lib-tk',
'/home/ymorin007/.virtualenvs/humor15b/lib/python2.7/lib-old',
'/home/ymorin007/.virtualenvs/humor15b/lib/python2.7/lib-dynload',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/home/ymorin007/.virtualenvs/humor15b/local/lib/python2.7/site-packages']

我的设置文件

########## COMPRESSION CONFIGURATION
STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'

PIPELINE_COMPILERS = (
'pipeline.compilers.less.LessCompiler',
)

PIPELINE_CSS = {
'humor15': {
'source_filenames': (
'css/bootstrap.min.css',
'css/base.css',
'users/css/base.css',
'signin/css/base.css',
'css/media.css',
),
'output_filename': 'css/humor15.css',
'extra_context': {
'media': 'screen,projection',
},
},
}

PIPELINE_JS = {
'humor15': {
'source_filenames': (
'js/bootstap.min.js',
),
'output_filename': 'js/humor15.js',
}
}

########## END COMPRESSION CONFIGURATION

THIRD_PARTY_APPS = (
'ckeditor', # https://github.com/shaunsephton/django-ckeditor#installation
'crispy_forms',
'django_countries', # https://pypi.python.org/pypi/django-countries http://en.wikipedia.org/wiki/ISO_3166-1
'django_mobile',
'pipeline',
'social.apps.django_app.default', # http://psa.matiasaguirre.net/
)

INSTALLED_APPS = DJANGO_APPS + HUMOR15_APPS + THIRD_PARTY_APPS + LOCAL_APPS

最佳答案

由于版本 1.4 django-pipeline 更改了模板标签名称,您必须替换:

{% load compressed %}
{% compressed_css 'foo' %}
{% compressed_js 'bar' %}

与:

{% load pipeline %}
{% stylesheet 'foo' %}
{% javascript 'bar' %}

参见http://django-pipeline.readthedocs.org/en/latest/usage.html#templatetags了解详情。

关于Django-pipeline 'compressed' 不是有效的标签库 : ImportError raised loading pipeline. templatetags.compressed:没有名为 conf 的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27972007/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com