Thursday, January 29, 2015

Namespace url lookup inside template of an app


writing currently an app which should show different things based on
namespace which is working already, but I do have problems with
generating the right url inside the templates of that app.
I tried to use:
{% url 'myaddons:index' %}
but that always shows the same namespace url the last one attached.

Currently have defined inside that app:
urlpatterns = patterns('',
url(r'^$', 'myaddons.views.index', name='index'),

Then have 2 other apps in one I define:
urlpatterns = patterns('',
url(r'^addons/', include('myaddons.urls',
namespace='wow-myaddons', app_name='myaddons')),

in the other one:
urlpatterns = patterns('',
url(r'^addons/', include('myaddons.urls', namespace='ws-myaddons',

The base one is:

url(r'^wow/', include('warcraft.urls')),
url(r'^ws/', include('wildstar.urls')),

With what I tried it always resolve to:

I want it to resolve to:
/wow/addons/ if called with /wow/
/ws/addons/ if called with /ws/


You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment