Typo on that typo! That slash should also be inside the parenthesis:
(r'^time/plus/(\d{1,2})/$', hours_ahead)
Note, though, I tend not to be so specific with URL matching... consider if
someone hacked a URL to read time/plus/999/ ... The above will cause a 404,
where letting it through to your
(r'^time/plus/\d{1,2}/$', hours_ahead),this line,you should use () for
d{1,2}
(r'^time/plus/\(d{1,2})/$', hours_ahead)
在 2011年2月18日星期五UTC+8下午11时04分13秒,Dipo Elegbede写道:
>
> Hi all,
>
> i am currently reading the django book and following the examples step by
> step.
>
> I have a view defined as
Thumbs up Tom.
I didn't even bother to open the links you sent, I just finished the
tutorial.
The name of the link said it all, capturing-text-in urls.
I am most grateful.
thanks all.
I would have to read the links however to master these things.
Regards.
On Fri, Feb 18, 2011 at 4:20 PM, Tom
On Fri, Feb 18, 2011 at 3:04 PM, Dipo Elegbede wrote:
>
> Hi all,
> i am currently reading the django book and following the examples step by
> step.
> I have a view defined as follows:
> from django.http import Http404, HttpResponse
> import datetime
> #def myhome(request):
> # message = """
Hi all,
i am currently reading the django book and following the examples step by
step.
I have a view defined as follows:
from django.http import Http404, HttpResponse
import datetime
#def myhome(request):
#message = """
#MY HOME
#
#
5 matches
Mail list logo