#17716: include(arg, namespace=None, app_name=None) replace app_name with 
namespace
-----------------------------+---------------------------------
     Reporter:  blackip@…    |      Owner:  nobody
         Type:  Bug          |     Status:  new
    Component:  Core (URLs)  |    Version:  1.4-alpha-1
     Severity:  Normal       |   Keywords:  include reverse url
 Triage Stage:  Unreviewed   |  Has patch:  0
Easy pickings:  0            |      UI/UX:  0
-----------------------------+---------------------------------
 When we register urls - we can specify app_name like this

 urlpatterns = patterns('',
     url(r'^inventory/', include('inventory.urls', app_name='inventory')),
     url(r'^cart/', include('cart.urls',app_name='cart')),

 Then we can use reverse method or {% url cart:cart  %} to generate url.

 But it does not work - ''got NoReverseMatch at /cart/

 u'cart' is not a registered namespace
 Request Method: GET
 Request URL:    http://localhost:8000/cart/
 Django Version: 1.4a1
 ''

 When I register urls like this

     url(r'^inventory/', include('inventory.urls', namespace='inventory')),
     url(r'^cart/', include('cart.urls',namespace='cart')),

 IT DOES WORK !

 According to documentation format for urls should be

 {% url app_name:view_name  %}
 but actual format is
 {% url namespace:view_name  %}

 I think this is a bug



 The source of bug may be in

 file /usr/local/lib/python2.7/site-packages/django/conf/urls/__init__.py
 function include(arg, namespace=None, app_name=None)

 It returns tuple (urlconf_module, app_name, namespace)
 It looks like it should be (urlconf_module, namespace, app_name)

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17716>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to