On Sat, 2009-04-11 at 17:49 -0500, James Bennett wrote:
> On Sat, Apr 11, 2009 at 5:13 PM, codecowboy <guy.ja...@gmail.com> wrote:
> > I've followed some examples from around the Django community and that
> > is why I use the reverse() method at all.  What is the point of using
> > the reverse() method?
> 
> Well, there's a problem you'll run into fairly often.
> 
> Suppose, for example, that you set up a weblog, and you have it at the
> URL "/weblog/". So in your templates you have links to "/weblog/", in
> your code the get_absolute_url() method of entries returns a string
> containing "/weblog/", any redirects involved have to have "/weblog/"
> in the URL, etc.
> 
> And then one day you suddenly need to deploy another copy of the
> appliation, but on a site which wants the weblog at "/blog/".

As James is well aware, but I'd like to make it explicit: This is
particularly true if you're writing an application that is going to be
distributed and used by a broader audience. You have absolutely no idea
where the end-users are going to install your application in the their
URL hierarchy. Tying your application to some particular URLs is simply
poor design practice in those cases.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to