#29068: Django urlpatterns has limit of allowed urls with namespace?
-------------------------------------+-------------------------------------
               Reporter:  Gerben     |          Owner:  nobody
  Morsink                            |
                   Type:  Bug        |         Status:  new
              Component:  Core       |        Version:  1.11
  (URLs)                             |
               Severity:  Normal     |       Keywords:  urlpatterns limit
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 I'm currently working on a huge site with a huge number of distinct
 urlpatterns, that are categorized in a tree pattern, starting with the
 project's urls.py and then going down the tree with include statements
 (sometimes namespaced), which in turn have their own include statements,
 untill we are about 4 branches away.

 Next to that many urlpatterns are conditional (if settings.DEBUG ... if
 'app_x' in installed_apps... etc).

 I have had issues with one of the last urlpatterns in the project's
 urls.py a lot on my production environment, on apache + wsgi ('No reverse
 found'), which I couldn't reproduce on my development machine with
 runserver . It has a namespace set. It was not a user facing endpoint so I
 forgot about it.

 Now I have added another urlpattern to the project's urls.py with a
 namespace and it too gives 'No reverse found' (it is reversed in a
 middleware, so the app does not start at all, making it easier to test).

 When I place the last urlpattern up in the projects urls.py that it comes
 as the second urlpattern, the app does start, so it looks like the
 urlpatterns are going into some kind of limit.

 For your reference this is the code that works when placed after the first
 urlpatterns definition, but not when placed at the bottom (I think nothing
 special).

 {{{
 if 'silk' in settings.INSTALLED_APPS:
     urlpatterns += [url(r'^silk/', include('silk.urls',
 namespace='silk'))]
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29068>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.eff0b65ddbe5c1d4b804f399c7e7ff44%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to