2006年11月15日 星期三 11:19
我使用了limudou的django step by step 教程
在教程4里。
我修改了url类为(r'^csv/(\w+)/$','newtest.csv_test.test'),
test函数很简单。
为:
def test(request):
return HttpResponse("test")
我使用http://localhost:8000/csv/address来访问。抛出
Request Method: GET Request URL: http://127.0.0.1:8000/csv/34/ Exception
Type: TypeError Exception Value: test() takes exactly 1 argument (2
given) Exception
Location: C:\Python25\lib\site-packages\django-
0.95-py2.5.egg\django\core\handlers\base.py in get_response, line 74
错误。
然后我修改url类为(r'^csv/$','newtest.csv_test.test'),
使用链接http://localhost:8000/csv/来访问
返回正确结果。
请问。为什么在第一种情况下会抛出异常?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://python.cn/pipermail/python-chinese/attachments/20061115/d2cc475f/attachment.htm
2006年11月15日 星期三 11:20
刚刚解决。 然来()里面的内容是传递给函数的参数。我这才发现 On 11/15/06, Kula <kulasama at gmail.com> wrote: > > 我使用了limudou的django step by step 教程 > 在教程4里。 > 我修改了url类为(r'^csv/(\w+)/$','newtest.csv_test.test'), > test函数很简单。 > 为: > def test(request): > return HttpResponse("test") > 我使用 http://localhost:8000/csv/address来访问。抛出 > Request Method: GET Request URL: http://127.0.0.1:8000/csv/34/ Exception > Type: TypeError Exception Value: test() takes exactly 1 argument (2 given) Exception > Location: C:\Python25\lib\site-packages\django- > 0.95-py2.5.egg\django\core\handlers\base.py in get_response, line 74 > 错误。 > 然后我修改url类为(r'^csv/$','newtest.csv_test.test'), > 使用链接http://localhost:8000/csv/来访问 > 返回正确结果。 > 请问。为什么在第一种情况下会抛出异常? > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20061115/9f7bfc7f/attachment.html
2006年11月15日 星期三 14:35
Ä¿µÄ:Ïë¸øµÃµ½µÄÍøÒ³html´úÂëÀïµÄͼƬ¼ÓÉÏÓòÃûµÃµ½¾ø¶Ô·¾¶ ÒÔÏÂÊǽØÈ¡µÄÄ³Ò³Ãæhtml´úÂëµÄÒ»¶Î:ÕýÔò·ÖÎöÈçÏÂ: image_src_re = re.compile(r'(
http://www.domain.com/'+image_src.re.search(htmlsou rce).group(2)+r'\3',htmlsource) ÎÒÏëµÃµ½Ìæ»»ºóµÄЧ¹ûÊÇ
http://www.domain.com/images/smilies/qq35.gif" align="absmiddle" border="0">
http://www.domain.com/images/smilies/qq54.gif" align="absmiddle" border="0"> ¿Éʵ¼ÊµÃµ½µÄ½á¹ûÊÇ
http://www.domain.com/images/smilies/qq35.gif" align="absmiddle" border="0">
http://www.domain.com/images/smilies/qq35.gif" align="absmiddle" border="0"> ¾ÍÊÇÕû¸öÒ³ÃæÀïËùÓеÄͼƬµØÖ·¶¼±»ÕýÔò»ñµÃµÄµÚÒ»¸öµØÖ·Ìæ»»ÁË,ÕýÔòÓ¦¸ÃÔõÑù¸Äд ²ÅÄܵõ½¶ÔÓ¦µÄµØÖ·ÄØ?ÍûÖ¸½Ì,Èç¹ûÕýÔòʵÏÖ²»ÁË,ÎÒÓ¦¸ÃÔõÑùд²ÅÄܴﵽĿµÄ?²Ù×÷¶Ô ÏóÊÇ´æÔÚ±¾µØ´ÅÅ̵ľ²Ì¬ÍøÒ³. -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20061115/ce460b72/attachment.html
Zeuux © 2025
京ICP备05028076号