免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1727 | 回复: 0
打印 上一主题 下一主题

django下的报错 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-07-18 11:22 |只看该作者 |倒序浏览
本帖最后由 tz104 于 2013-07-18 11:23 编辑

django 1.5
python 2.6.5
模仿着django step by step:http://www.lhelper.org/dev/djang ... test/doc/tut07.html 的例子学习
在例子“创建通讯录”中,遇到了报错,如下:
TypeError at /address/
__init__() takes exactly 1 non-keyword argument (2 given)
Request Method:        GET
Request URL:        http://192.168.1.111:8080/address/
Django Version:        1.5.1
Exception Type:        TypeError
Exception Value:       
__init__() takes exactly 1 non-keyword argument (2 given)
Exception Location:        /usr/lib/python2.6/site-packages/django/core/handlers/base.py in get_response, line 115
Python Executable:        /usr/bin/python
Python Version:        2.6.5
Python Path:       
['/opt/Django_Pro',
'/opt/Django_Pro/Django_Pro',
'/opt/Django_Pro',
'/usr/lib/python2.6/site-packages/distribute-0.6.49-py2.6.egg',
'/usr/lib/python26.zip',
'/usr/lib/python2.6',
'/usr/lib/python2.6/plat-linux2',
'/usr/lib/python2.6/lib-tk',
'/usr/lib/python2.6/lib-old',
'/usr/lib/python2.6/lib-dynload',
'/usr/lib/python2.6/site-packages',
'/usr/lib/python2.6/site-packages/gtk-2.0'
不知如何破?
address下的urs.py如下:
from django.conf.urls import *
from django.views.generic.list import ListView
from address.models import Address

info_dict = {
    'queryset': Address.objects.all(),
}

urlpatterns = patterns('',
   url(r'^/?$','django.views.generic.list.ListView',info_dict),
)

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP