Changeset - 8e01669dd403
[Not reviewed]
0 2 0
Branko Majic (branko) - 10 years ago 2014-01-05 00:35:47
branko@majic.rs
DJPYD-1: Improved handling of URL patterns in order to have better support for namespacs.
2 files changed with 20 insertions and 1 deletions:
0 comments (0 inline, 0 general)
django_pydenticon/urls.py
Show inline comments
 
@@ -10,3 +10,22 @@ urlpatterns = patterns(
 
    # View for rendering an identicon image.
 
    url(r'^image/(?P<data>.+)$', image, name="image")
 
    )
 

	
 
def get_patterns(instance="django_pydenticon"):
 
    """
 
    Generates URL patterns for Django Pydenticon application. The return value
 
    of this function can be used directly by the django.conf.urls.include
 
    function.
 

	
 
    Arguments:
 

	
 
      instance - Instance namespace that should be assigned to generated URL
 
      patterns.
 

	
 
    Returns:
 

	
 
      Tuple consisting out of URL patterns, instance namespace, and application
 
      namespace.
 
    """
 

	
 
    return urlpatterns, instance, "django_pydenticon"
testproject/testproject/urls.py
Show inline comments
 
@@ -15,5 +15,5 @@ urlpatterns = patterns(
 
    url(r'^admin/', include(admin.site.urls)),
 

	
 
    # URLs for Django Pydenticon.
 
    url(r'^identicon/', include(django_pydenticon.urls)),
 
    url(r'^identicon/', include(django_pydenticon.urls.get_patterns())),
 
)
0 comments (0 inline, 0 general)