On Fri, Oct 30, 2009 at 6:03 PM, Continuation <selforgani...@gmail.com> wrote: > > I'm new to Django. Having a great time learning from the doc. > > Normally the doc explains the topics in hand very clearly. But on 1 > subject I'm still confused after going over the doc: URL Namespaces. > > Can someone explain to me what URL Namespaces is for and how does it > work? Any external articles or tutorials that would help me? > > The doc mentioned something about multiple instances of an app, what > does that mean? For example if I want to use an app (say > django.contrib.comment) I'd add it to INSTALLED_APPS and start using > it. So what's the purpose of creating multiple instances of an app and > how exactly do I create multiple instances?
It's not about having multiple instances of an app in INSTALLED_APPS - it's about having the URLs for an application deployment multiple times in your urls.py. For example - Say you want to have two administration interfaces: a full admin interface for superusers, and a cut down admin interface (that has a limited set of models, and maybe some extra helper views) for editors. You can deploy one instance of the admin app at at /admin, and the second instance at /editors. However, both instances will have an "add new article" named URL (one at /admin/content/article/add, and one at /editors/content/article/add). You need to have a way to distinguish the two named URLs, and namespaces is how you do this. If you're just starting out, you probably don't need to worry about URL namespaces too much. When you start writing your own reusable apps, you'll need to pay more attention to URL namespaces, but for now, get a handle on simple unnamespaced named URLs. Yours, Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---