在遵循 django 教程时解耦 urls.py 的问题
http://docs.djangoproject.com/en/dev/intro/tutorial03/< /a>
我正在执行解耦 URLconf 其中教程说明了如何解耦 urls.py
。完全按照它所说的去做时,我收到以下错误-
error at /polls/1/
nothing to repeat
Request Method: GET
Request URL: http://localhost:8000/polls/1/
Exception Type: error
Exception Value:
nothing to repeat
Exception Location: C:\jython2.5.1\Lib\re.py in _compile, line 241
Python Executable: C:\jython2.5.1\jython.bat
Python Version: 2.5.1
Python Path: ['E:\\Programming\\Project\\django_app\\mysite', 'C:\\jython2.5.1\\Lib\\site-packages\\setuptools-0.6c11-py2.5.egg', 'C:\\jython2.5.1\\Lib', '__classpath__', '__pyclasspath__/', 'C:\\jython2.5.1\\Lib\\site-packages']
Server time: Mon, 12 Apr 2010 12:02:56 +0530
http://docs.djangoproject.com/en/dev/intro/tutorial03/
I was at the step Decoupling the URLconfs where the tutorial illustrates how to decouple urls.py
. On doing exactly what it says, i get the following error-
error at /polls/1/
nothing to repeat
Request Method: GET
Request URL: http://localhost:8000/polls/1/
Exception Type: error
Exception Value:
nothing to repeat
Exception Location: C:\jython2.5.1\Lib\re.py in _compile, line 241
Python Executable: C:\jython2.5.1\jython.bat
Python Version: 2.5.1
Python Path: ['E:\\Programming\\Project\\django_app\\mysite', 'C:\\jython2.5.1\\Lib\\site-packages\\setuptools-0.6c11-py2.5.egg', 'C:\\jython2.5.1\\Lib', '__classpath__', '__pyclasspath__/', 'C:\\jython2.5.1\\Lib\\site-packages']
Server time: Mon, 12 Apr 2010 12:02:56 +0530
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查您的正则表达式语法。特别是,查看模式开头的
?
之前是否缺少左括号,如。
(解释:“无重复”是一个正则表达式错误,它是由于
# ^ note the missing parenthesis?
正则表达式运算符发生在其前面没有可以合理附加的内容而引起的。?
?(?P<...>...) 中的 code> 会被特殊处理,但是如果您忘记了左括号,正则表达式引擎将处理?
中的?
常规方式,在^
之后没有任何意义。)上面的内容所示
。
(解释:“无重复”是一个正则表达式错误,它是由于
?
正则表达式运算符发生在其前面没有可以合理附加的内容而引起的。?
?(?P<...>...) 中的 code> 会被特殊处理,但是如果您忘记了左括号,正则表达式引擎将处理?
中的?
常规方式,在^
之后没有任何意义。)Check your regex syntax. In particular, see if you are missing an opening parenthesis before a
?
towards the beginning of the pattern, as ininstead.
(An explanation: "nothing to repeat" is a regex error which arises due to an
# ^ note the missing parenthesis?
regex operator occurring where it is not preceded by something which it can sensibly attach to. The?
in(?P<...>...)
is treated specially, but if you forget the opening parenthesis, the regex engine will treat?
in the regular way, which makes no sense right after^
.)The above should read
instead.
(An explanation: "nothing to repeat" is a regex error which arises due to an
?
regex operator occurring where it is not preceded by something which it can sensibly attach to. The?
in(?P<...>...)
is treated specially, but if you forget the opening parenthesis, the regex engine will treat?
in the regular way, which makes no sense right after^
.)