On Dec 18, 9:10 am, shabda <[EMAIL PROTECTED]> wrote:
> I have my urls.py defined as
> urlpatterns = patterns('app.views',
> (r'^foo/$', 'foo'),
> (r'^bar/$', 'bar'),)
>
> Now from a template i need to access these urls. So inside the
> template we can refer them as /foo/, /bar/. However later when I
> change the urls.py, these urls defined in urls.py would break. What
> would be a good way around this?
You can name your URL patterns and then use the "url" templatetag in
your templates. Start here:
http://www.djangoproject.com/documentation/url_dispatch/#naming-url-patterns
and follow on to the "url" templatetag description.
-Rajesh
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---