Python论坛  - 讨论区

标题:[python-chinese] 看limodou的Django Step by Step (4)出现的问题

2007年09月17日 星期一 16:31

Wu MingChao pykandrcn在gmail.com
星期一 九月 17 16:31:34 HKT 2007

完全按里成的步骤做的,没有出现limodou所说的效果。
只出现如下信息:

Traceback (most recent call last):

  File "C:\Python25\lib\site-packages\django-0.95.1-py2.5.egg\django\core\servers\basehttp.py",
line 272, in run
    self.result = application(self.environ, self.start_response)

  File "C:\Python25\lib\site-packages\django-0.95.1-py2.5.egg\django\core\servers\basehttp.py",
line 615, in __call__
    return self.application(environ, start_response)

  File "C:\Python25\lib\site-packages\django-0.95.1-py2.5.egg\django\core\handlers\wsgi.py",
line 148, in __call__
    response = self.get_response(request.path, request)

  File "C:\Python25\lib\site-packages\django-0.95.1-py2.5.egg\django\core\handlers\base.py",
line 102, in get_response
    return self.get_technical_error_response(request)

  File "C:\Python25\lib\site-packages\django-0.95.1-py2.5.egg\django\core\handlers\base.py",
line 134, in get_technical_error_response
    return debug.technical_500_response(request, *sys.exc_info())

  File "C:\Python25\lib\site-packages\django-0.95.1-py2.5.egg\django\views\debug.py",
line 96, in technical_500_response
    pre_context_lineno, pre_context, context_line, post_context =
_get_lines_from_file(filename, lineno, 7)

  File "C:\Python25\lib\site-packages\django-0.95.1-py2.5.egg\django\views\debug.py",
line 174, in _get_lines_from_file
    context_line = source[lineno].strip('\n')

IndexError: list index out of range
检查了好向遍,没有什么不同的不知道错在哪里
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://python.cn/pipermail/python-chinese/attachments/20070917/3a871129/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年09月17日 星期一 16:43

limodou limodou在gmail.com
星期一 九月 17 16:43:54 HKT 2007

On 9/17/07, Wu MingChao <pykandrcn在gmail.com> wrote:
> 完全按里成的步骤做的,没有出现limodou所说的效果。
> 只出现如下信息:Traceback (most recent call last):
>
>  File
> "C:\Python25\lib\site-packages\django-0.95.1-py2.5.egg\django\core\servers\basehttp.py",
> line 272, in run
>  self.result = application(self.environ, self.start_response)
>
>  File
> "C:\Python25\lib\site-packages\django-0.95.1-py2.5.egg\django\core\servers\basehttp.py",
> line 615, in __call__
>  return self.application(environ, start_response)
>
>  File
> "C:\Python25\lib\site-packages\django-0.95.1-py2.5.egg\django\core\handlers\wsgi.py",
> line 148, in __call__
>  response = self.get_response(request.path, request)
>
>  File
> "C:\Python25\lib\site-packages\django-0.95.1-py2.5.egg\django\core\handlers\base.py",
> line 102, in get_response
>  return self.get_technical_error_response(request)
>
>  File
> "C:\Python25\lib\site-packages\django-0.95.1-py2.5.egg\django\core\handlers\base.py",
> line 134, in get_technical_error_response
>  return debug.technical_500_response(request, *sys.exc_info())
>
>  File
> "C:\Python25\lib\site-packages\django-0.95.1-py2.5.egg\django\views\debug.py",
> line 96, in technical_500_response
>  pre_context_lineno, pre_context, context_line, post_context =
> _get_lines_from_file(filename, lineno, 7)
>
>  File
> "C:\Python25\lib\site-packages\django-0.95.1-py2.5.egg\django\views\debug.py",
> line 174, in _get_lines_from_file
>  context_line = source[lineno].strip('\n')
>
> IndexError: list index out of range
> 检查了好向遍,没有什么不同的不知道错在哪里
>
你的django版本有些太旧了,换成0.96试试。


-- 
I like python!
UliPad <>: http://code.google.com/p/ulipad/
My Blog: http://www.donews.net/limodou

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年09月17日 星期一 17:12

Wu MingChao pykandrcn在gmail.com
星期一 九月 17 17:12:31 HKT 2007

试了一下,还是不行。

Traceback (most recent call last):

  File "C:\Python25\Lib\site-packages\django\core\servers\basehttp.py",
line 272, in run
    self.result = application(self.environ, self.start_response)

  File "C:\Python25\Lib\site-packages\django\core\servers\basehttp.py",
line 614, in __call__
    return self.application(environ, start_response)

  File "C:\Python25\Lib\site-packages\django\core\handlers\wsgi.py",
line 189, in __call__
    response = self.get_response(request)

  File "C:\Python25\Lib\site-packages\django\core\handlers\base.py",
line 111, in get_response
    return debug.technical_500_response(request, *sys.exc_info())

  File "C:\Python25\Lib\site-packages\django\views\debug.py", line 96,
in technical_500_response
    pre_context_lineno, pre_context, context_line, post_context =
_get_lines_from_file(filename, lineno, 7)

  File "C:\Python25\Lib\site-packages\django\views\debug.py", line
174, in _get_lines_from_file
    context_line = source[lineno].strip('\n')

IndexError: list index out of range




在07-9-17,limodou <limodou at gmail.com> 写道:
>
> On 9/17/07, Wu MingChao <pykandrcn at gmail.com> wrote:
> > 完全按里成的步骤做的,没有出现limodou所说的效果。
> > 只出现如下信息:Traceback (most recent call last):
> >
> >  File
> > "C:\Python25\lib\site-packages\django-
> 0.95.1-py2.5.egg\django\core\servers\basehttp.py",
> > line 272, in run
> >  self.result = application(self.environ, self.start_response)
> >
> >  File
> > "C:\Python25\lib\site-packages\django-
> 0.95.1-py2.5.egg\django\core\servers\basehttp.py",
> > line 615, in __call__
> >  return self.application(environ, start_response)
> >
> >  File
> > "C:\Python25\lib\site-packages\django-
> 0.95.1-py2.5.egg\django\core\handlers\wsgi.py",
> > line 148, in __call__
> >  response = self.get_response(request.path, request)
> >
> >  File
> > "C:\Python25\lib\site-packages\django-
> 0.95.1-py2.5.egg\django\core\handlers\base.py",
> > line 102, in get_response
> >  return self.get_technical_error_response(request)
> >
> >  File
> > "C:\Python25\lib\site-packages\django-
> 0.95.1-py2.5.egg\django\core\handlers\base.py",
> > line 134, in get_technical_error_response
> >  return debug.technical_500_response(request, *sys.exc_info())
> >
> >  File
> > "C:\Python25\lib\site-packages\django-
> 0.95.1-py2.5.egg\django\views\debug.py",
> > line 96, in technical_500_response
> >  pre_context_lineno, pre_context, context_line, post_context =
> > _get_lines_from_file(filename, lineno, 7)
> >
> >  File
> > "C:\Python25\lib\site-packages\django-
> 0.95.1-py2.5.egg\django\views\debug.py",
> > line 174, in _get_lines_from_file
> >  context_line = source[lineno].strip('\n')
> >
> > IndexError: list index out of range
> > 检查了好向遍,没有什么不同的不知道错在哪里
> >
> 你的django版本有些太旧了,换成0.96试试。
>
>
> --
> I like python!
> UliPad <>: http://code.google.com/p/ulipad/
> My Blog: http://www.donews.net/limodou
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://python.cn/pipermail/python-chinese/attachments/20070917/46851ece/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年09月17日 星期一 17:19

limodou limodou在gmail.com
星期一 九月 17 17:19:48 HKT 2007

感觉怎么是环境的问题,把你的测程程序打个包发上来我看一下。

-- 
I like python!
UliPad <>: http://code.google.com/p/ulipad/
My Blog: http://www.donews.net/limodou

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年09月17日 星期一 17:20

limodou limodou在gmail.com
星期一 九月 17 17:20:14 HKT 2007

On 9/17/07, limodou <limodou在gmail.com> wrote:
> 感觉怎么是环境的问题,把你的测程程序打个包发上来我看一下。
>
还是发到我的个人邮箱为好。 limodou在gmail.com

-- 
I like python!
UliPad <>: http://code.google.com/p/ulipad/
My Blog: http://www.donews.net/limodou

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年09月17日 星期一 17:46

limodou limodou在gmail.com
星期一 九月 17 17:46:39 HKT 2007

好象是你的文件的回车换行符有\r\n还有\n的,不一致造成的。另在output中你把response写成了respone,所以在后面执行时还会出错。同时在我的教程中我将cvs.html改为了csv.html,而你的还没有修改。

-- 
I like python!
UliPad <>: http://code.google.com/p/ulipad/
My Blog: http://www.donews.net/limodou

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年09月18日 星期二 08:21

Wu MingChao pykandrcn在gmail.com
星期二 九月 18 08:21:31 HKT 2007

换行符的问题大概是我编辑器混用造成的,把另外二处的错误修正后一切OK了。这个我用什么换行符都能看出来?

在07-9-17,limodou <limodou at gmail.com> 写道:
>
> 好象是你的文件的回车换行符有\r\n还有\n的,不一致造成的。另在output中你把response写成了respone,所以在后面执行时还会出错。
> 同时在我的教程中我将cvs.html改为了csv.html,而你的还没有修改。
>
> --
> I like python!
> UliPad <>: http://code.google.com/p/ulipad/
> My Blog: http://www.donews.net/limodou
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://python.cn/pipermail/python-chinese/attachments/20070918/3e611b91/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年09月18日 星期二 08:34

limodou limodou在gmail.com
星期二 九月 18 08:34:47 HKT 2007

On 9/18/07, Wu MingChao <pykandrcn在gmail.com> wrote:
> 换行符的问题大概是我编辑器混用造成的,把另外二处的错误修正后一切OK了。这个我用什么换行符都能看出来?
>
换行符混用对于python解释程序时是有影响的,所以关系也很大。

-- 
I like python!
UliPad <>: http://code.google.com/p/ulipad/
My Blog: http://www.donews.net/limodou

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号