I need 2 URLs to show the exact same view and URL patterns, so in my main urls.py file, I do this:
url(r'^evenements/', include('project.events.urls', namespace='events')),
url(r'^tourisme/evenements/', include('project.events.urls', namespace="tourisme_event", app_name='events')),
And then in my events app, I have this in the urls.py
urlpatterns = patterns('',
url(r'^$', views.listing, name='index'),
url(r'^(?P<slug>.*)/$', views.detail, name='detail'),
)
Now what I'm trying to achieve is to show the exact same view for both the URLs, but I need the links to work with this in the template:
{% url 'events:detail' event.event.slug %}
To my understanding, using "app_name" should allow me to do just that, but here are the different things that happen:
- app_name only on "tourisme/evenements": both pages show the "tourisme/evenements" URL with the
{% url %}tag - app_name on both: both pages show the "evenements" URL with the
{% url %}tag - app_name on neither: both pages show the "evenements" URL with the
{% url %}tag
I can't get it to show a different URL on both pages. I did what was told in this answer: https://stackoverflow.com/a/8039846/2174532
Any idea why that wouldn't work? BTW, I'm on Django 1.6.
Thanks