Hello all,

I am developping a second app in the same project and want to use a
simple.direct_to_template view.

Both of my app require a login from user, thus I have in both app a
login page.
With a lot of creativity I named both of my login pages and index
pages ; login and index, with the corresponding templates login.html
and index.html.

I have a main urls.py file which include the urls of the two other
apps like this :
urlpatterns += patterns('',
    url(r'^app1/', include('app1.urls')),
    url(r'^app2/', include('app2.urls')),
)

In both app specific urls.py I have the following (simplified) :
urlpatterns = patterns('app1.views',
   (r'^$', 'index')
   )
urlpatterns += patterns('',
   (r'^login', 'django.views.generic.simple.direct_to_template',
{'template': 'login.html'}),
)

My problem is that the first app mentioned in settings "installed
apps" seem to have precedence in the template loading. It's like the
app tree is not taken into account in {'template': 'login.html'}. Thus
because they have the same name, I am always using the template of the
first app declared in installed apps.

If I rename the template index_app1.html and index_app2.html it works
as expected. So this is an option but...

Is there a way to tell which template to use?

Thanks in advance for your help!

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

Reply via email to