Re: usage of url template tag
On Wed, Mar 21, 2012 at 2:06 PM, Daniel Roseman <daniel@roseman.org.uk> wrote:
> On Wednesday, 21 March 2012 03:01:23 UTC-7, Larry....@gmail.com wrote:
>>
>>
>> I'm very new to django. The rest of the URL comes from the index
>> function in views.py. I wasn't sure if it violated the DRY principle
>> to hardcode it.
>
>
> Fine, but you can't reverse a URL that does not exist. If you tried to
> access "/report/faloom/EventLog/" in your browser, you would get a 404
> because you have no URLconf that matches it. So there's no point in
> outputting that URL in your template.
That's not true. My urlpatterns has:
(r'^report/(\w+)/(\w+)/$', motor.core.reports.views.view)
so /report/faloom/EventLog/ get routed to the view function in
motor/core/report/views.py, which renters the page.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home