Trouble overriding registration templates

28 views
Skip to first unread message

Joshua Russo

unread,
Jul 12, 2011, 10:24:29 PM7/12/11
to django...@googlegroups.com
I want to use my own logout template but it doesn't want to pick it up. The login template worked just fine, but for anything that's already in the admin's template/registration folder, it only wants to use those. I tried putting my templates folder before the admin templates folder in the list of template folder in the settings file but that didn't do anything. Any suggestions?

Szabo, Patrick (LNG-VIE)

unread,
Jul 13, 2011, 2:28:32 AM7/13/11
to django...@googlegroups.com

Did you write your own view for that purpose ?!

In that view you could use render_to_response and pass you own template to that.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/VcsTSOx1iSoJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

. . . . . . . . . . . . . . . . . . . . . . . . . .

Patrick Szabo
XSLT Developer

LexisNexis
Marxergasse 25, 1030 Wien

patric...@lexisnexis.at

Tel.: 00431 534521573

Fax: +43 (1) 534 52 - 146



Joshua Russo

unread,
Jul 13, 2011, 7:01:15 AM7/13/11
to django...@googlegroups.com
I do have a views that are basically just proxies for the author views, but I was under the impression that if I just wanted to replace the registration templates then all I needed was a registration directory in my templates directory with the right file names. From there it should just take the first template it finds in the list of template directories in settings.

Where is the default login.html template?

Joshua Russo

unread,
Jul 13, 2011, 7:04:33 AM7/13/11
to django...@googlegroups.com
Sorry, auto correct strikes again. I was trying to reply quickly from my phone. I meant auth, not author views. 

Joshua Russo

unread,
Jul 13, 2011, 12:00:06 PM7/13/11
to django...@googlegroups.com
Am I wrong about how templates work?

Andre Terra

unread,
Jul 13, 2011, 12:30:21 PM7/13/11
to django...@googlegroups.com
Or render() which is the recommended shortcut since 1.3.

https://docs.djangoproject.com/en/1.3/topics/http/shortcuts/#render


Cheers,
André

Joshua Russo

unread,
Jul 13, 2011, 12:46:03 PM7/13/11
to django...@googlegroups.com
That's fine, but I was under the impression that the templates could be overridden just by creating the proper path in my template directories. Is that not true?

Shawn Milochik

unread,
Jul 13, 2011, 12:50:03 PM7/13/11
to django...@googlegroups.com

It's true. Check the order of your TEMPLATE_DIRS in settings.py. If you
don't have them specified and are relying on the automatic detection of
a 'templates' dir in your app folders then check the order of your
INSTALLED_APPS.

If you're having an issue it's probably a good idea to explicitly
populate TEMPLATE_DIRS.

Hopefully this will help:
https://docs.djangoproject.com/en/1.3/ref/templates/api/#the-template-dirs-setting


Joshua Russo

unread,
Jul 13, 2011, 1:13:06 PM7/13/11
to django...@googlegroups.com
Cool, thanks for the confirmation. 

I do have my template directories explicitly listed in TEMPLATE_DIRS. I even made sure that my app's templates came before the admin templates, but for some reason it's not picking up my /registration/logged_out.html and the others that show up in the admin's templates/registration directory. My /registration/login.html works just fine.

I'll try playing with the order of the installed apps and see if that makes any difference.

Joshua Russo

unread,
Jul 13, 2011, 1:18:51 PM7/13/11
to django...@googlegroups.com
*light bulb* I forgot about my development vs production settings. I was only changing the TEMPLATE_DIRS in the main settings.py that represents my production settings. I'm not in a place where I can test this but I'm almost certain that's what the problem is.

Shawn Milochik

unread,
Jul 13, 2011, 1:24:00 PM7/13/11
to django...@googlegroups.com

To be clear, when you say registration/login, you mean templates/registration/login, correct?

Your 'registration' directory should be in a 'templates' dir.

Joshua Russo

unread,
Jul 13, 2011, 1:43:56 PM7/13/11
to django...@googlegroups.com
Correct

Joshua Russo

unread,
Jul 19, 2011, 11:19:29 PM7/19/11
to django...@googlegroups.com
btw, I was correct, it was the development settings causing the problem

On Wed, Jul 13, 2011 at 1:43 PM, Joshua Russo <josh.r...@gmail.com> wrote:
Correct

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/K5yKllF_gPcJ.
Reply all
Reply to author
Forward
0 new messages