没有名为 csrf 的模块

发布于 2024-08-23 14:20:52 字数 1996 浏览 4 评论 0原文

我有: Python 2.6 姜戈1.1.1 我从 git://github.com/digi604/django-cms-2.0.git 下载了 Django-cms 我通过了南/上

我坚持这一点:

启用南同步数据库返回后:

Synced:
 > django.contrib.auth
 > django.contrib.contenttypes
 > django.contrib.sessions
 > django.contrib.admin
 > django.contrib.sites
 > publisher
 > mptt
 > reversion
 > example.categories
 > south
 > example.sampleapp

Not synced (use migrations):
 - cms
 - cms.plugins.text
 - cms.plugins.picture
 - cms.plugins.file
 - cms.plugins.flash
 - cms.plugins.link
 - cms.plugins.snippet
 - cms.plugins.googlemap
 - cms.plugins.teaser
 - cms.plugins.video
 - cms.plugins.twitter
 - cms.plugins.inherit
(use ./manage.py migrate to migrate these)

startserver返回(当我在浏览器127.0.0.1:8000中打开时):

Traceback (most recent call last):
File "/usr/lib/pymodules/python2.6/django/core/servers/basehttp.py",
line 279, in run
self.result = application(self.environ, self.start_response)

File "/usr/lib/pymodules/python2.6/django/core/servers/basehttp.py",
line 651, in __call__
return self.application(environ, start_response)

File "/usr/lib/pymodules/python2.6/django/core/handlers/wsgi.py",
line 230, in __call__
self.load_middleware()

File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py",
line 42, in load_middleware
raise exceptions.ImproperlyConfigured,
'Error importing middleware %s: "%s"' % (mw_module, e)

ImproperlyConfigured: Error importing middleware django.middleware.csrf:
"No module named csrf"

[25/Feb/2010 05:49:43] "GET / HTTP/1.1" 500 746

当我评论行时:

#'django.middleware.csrf.CsrfViewMiddleware',  - in MIDDLEWARE_CLASSES
#'django.core.context_processors.csrf', - in TEMPLATE_CONTEXT_PROCESSORS

我现在可以运行它,但是当我试图添加我看到的页面:

Template error

In template /home/gennadich/Documents/django-cms-2.0/cms/templates/admin/cms/page/change_form.html, error at line 97
Invalid block tag: 'csrf_token'

I have:
Python 2.6
Django 1.1.1
I downloaded Django-cms from git://github.com/digi604/django-cms-2.0.git
I passed south off/on

I stuck on this:

After enabling south syncdb returns:

Synced:
 > django.contrib.auth
 > django.contrib.contenttypes
 > django.contrib.sessions
 > django.contrib.admin
 > django.contrib.sites
 > publisher
 > mptt
 > reversion
 > example.categories
 > south
 > example.sampleapp

Not synced (use migrations):
 - cms
 - cms.plugins.text
 - cms.plugins.picture
 - cms.plugins.file
 - cms.plugins.flash
 - cms.plugins.link
 - cms.plugins.snippet
 - cms.plugins.googlemap
 - cms.plugins.teaser
 - cms.plugins.video
 - cms.plugins.twitter
 - cms.plugins.inherit
(use ./manage.py migrate to migrate these)

startserver returns (when I open in browser 127.0.0.1:8000):

Traceback (most recent call last):
File "/usr/lib/pymodules/python2.6/django/core/servers/basehttp.py",
line 279, in run
self.result = application(self.environ, self.start_response)

File "/usr/lib/pymodules/python2.6/django/core/servers/basehttp.py",
line 651, in __call__
return self.application(environ, start_response)

File "/usr/lib/pymodules/python2.6/django/core/handlers/wsgi.py",
line 230, in __call__
self.load_middleware()

File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py",
line 42, in load_middleware
raise exceptions.ImproperlyConfigured,
'Error importing middleware %s: "%s"' % (mw_module, e)

ImproperlyConfigured: Error importing middleware django.middleware.csrf:
"No module named csrf"

[25/Feb/2010 05:49:43] "GET / HTTP/1.1" 500 746

When I commented lines:

#'django.middleware.csrf.CsrfViewMiddleware',  - in MIDDLEWARE_CLASSES
#'django.core.context_processors.csrf', - in TEMPLATE_CONTEXT_PROCESSORS

i could run it now, but when I'm trying to add page i see:

Template error

In template /home/gennadich/Documents/django-cms-2.0/cms/templates/admin/cms/page/change_form.html, error at line 97
Invalid block tag: 'csrf_token'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

时间你老了 2024-08-30 14:20:52

现在您已禁用 CSRF 模块,您不再有任何可用的 CSRF 标签。启用 CSRF 模块或删除所有 CSRF 标签。

Now that you've disabled the CSRF modules, you no longer have any CSRF tags available. Either enable the CSRF modules or remove all CSRF tags.

等风来 2024-08-30 14:20:52

禁用 South 或尝试 postgresql。我最终禁用了 South,因为我只是在我的开发机器上乱搞

[编辑]

这也适用于最新的 pinax trunk(2010 年 3 月 22 日)

[编辑]

尝试升级 django 的最新版本,此时为 1.2 beta

disable south or try postgresql. I ended up disabling south since i was just messing around on my dev machine

[EDIT]

this has worked for the latest pinax trunk too (Mar 22 2010)

[EDIT]

Try upgrading too the latest build of django, at this time 1.2 beta

筑梦 2024-08-30 14:20:52

看起来对于新的 django + django-cms 项目人员还没有发现标准和正确的程序。我从早上 9 点开始就在尝试。现在晚上 7:30。

Looks like no standard and correct procedure yet discovered for new django + django-cms Project People. I am trying since morning 9. Now evening 7:30.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文