django 1.3升级问题
我最近升级到 django 1.3。升级后,每当我使用 request.POST
时,我都会收到以下错误:
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py", line 86, in get_response
response = None
File "/public/gdp/trunk/src/ukl/lis/process/utils/error_handler.py", line 15, in __call__
return self.function(*args, **kwargs)
File "/usr/lib/python2.4/site-packages/django/views/decorators/cache.py", line 30, in _cache_controlled
# and this:
File "/public/gdp/trunk/src/ukl/lis/process/authentication/views.py", line 438, in login
form = loginForm(request.POST)
File "/usr/lib/python2.4/site-packages/django/core/handlers/modpython.py", line 101, in _get_post
self._load_post_and_files()
AttributeError: 'ModPythonRequest' object has no attribute '_load_post_and_files'
一旦我恢复到 django 1.0,错误就被修复了。
为什么 django 1.3 单独抛出这个错误?如何纠正呢?
I recently updgraded to django 1.3. After the upgrade, I get the following error whenever I used request.POST
:
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py", line 86, in get_response
response = None
File "/public/gdp/trunk/src/ukl/lis/process/utils/error_handler.py", line 15, in __call__
return self.function(*args, **kwargs)
File "/usr/lib/python2.4/site-packages/django/views/decorators/cache.py", line 30, in _cache_controlled
# and this:
File "/public/gdp/trunk/src/ukl/lis/process/authentication/views.py", line 438, in login
form = loginForm(request.POST)
File "/usr/lib/python2.4/site-packages/django/core/handlers/modpython.py", line 101, in _get_post
self._load_post_and_files()
AttributeError: 'ModPythonRequest' object has no attribute '_load_post_and_files'
Once I reverted back to django 1.0 the error is fixed.
Why is django 1.3 alone throwing this error? How to correct it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从 Django 1.0 到 Django 1.3 是一个很大的跳跃,很多项目可能已被弃用或不再使用,我建议您仅检查 middleware_classes 的一些文档
Django 中间件文档
Stepping from Django 1.0 to Django 1.3 is a big jump, a lot of items might have been deprecated or no longer used, I recommend you to just check some of the documentation for the middleware_classes
Django Middleware documentation
我尝试重新安装 mod-python,现在错误已修复。现在考虑迁移到 mod_wsgi。
I tried re-installing my mod-python and now the error is fixed. Now thinking of migrating to mod_wsgi.