-
Book Overview & Buying
-
Table Of Contents
Mastering Django: Core
By :
URL namespaces allow you to uniquely reverse named URL patterns even if different applications use the same URL names. It's a good practice for third-party apps to always use namespaced URLs. Similarly, it also allows you to reverse URLs if multiple instances of an application are deployed. In other words, since multiple instances of a single application will share named URLs, namespaces provide a way to tell these named URLs apart.
Django applications that make proper use of URL namespacing can be deployed more than once for a particular site. For example, django.contrib.admin has an AdminSite class which allows you to easily deploy more than once instance of the admin. A URL namespace comes in two parts, both of which are strings:
Change the font size
Change margin width
Change background colour