在遵循django教程时解耦url.py时出现问题
我在教程中演示了如何解耦在遵循django教程时解耦url.py时出现问题,django,url,jython,django-urls,Django,Url,Jython,Django Urls,我在教程中演示了如何解耦url.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
url.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
检查您的正则表达式语法。特别是,查看模式开头的
?
之前是否缺少一个左括号,如中所示
r'^?P<poll_id>\d+)/$'
# ^ note the missing parenthesis
r'^?P\d+/$'
#^请注意缺少的括号
以上内容应为:
r'^(?P<poll_id>\d+)/$'
r'^(?P\d+/$)
相反
(一种解释:“无需重复”是由于
?
正则表达式运算符之前没有可合理附加到的内容而发生的正则表达式错误。中的?
(?p…)
是专门处理的,但是如果您忘记了左括号,正则表达式引擎将以常规方式处理?
,这在^
之后就没有意义了。请检查您的正则表达式语法。特别是,查看模式开头的?
之前是否缺少一个左括号,如中所示
r'^?P<poll_id>\d+)/$'
# ^ note the missing parenthesis
r'^?P\d+/$'
#^请注意缺少的括号
以上内容应为:
r'^(?P<poll_id>\d+)/$'
r'^(?P\d+/$)
相反
(一种解释:“无需重复”是由于
?
正则表达式运算符之前没有可合理附加到的内容而发生的正则表达式错误。中的?
(?p…)
是经过特殊处理的,但是如果您忘记了左括号,正则表达式引擎将以常规方式处理?
,这在^
之后就没有意义了。您可以将url.py粘贴到这里吗?您可以将url.py粘贴到这里吗?