Opened 15 years ago

Closed 15 years ago

Last modified 6 years ago

#13061 closed Uncategorized (invalid)

Default login template is on bad place - registration/login.html TemplateDoesNotExist

Reported by: sopuch Owned by: nobody
Component: contrib.auth Version: 1.1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

django.contrib.auth.views.login points to default template (template_name=registration/login.html) to bad place - produce TemplateDoesNotExist error. I think, this template is in admin/login.html.

Change History (6)

comment:1 by James Bennett, 15 years ago

Resolution: invalid
Status: newclosed

No, that's the correct location. The admin does its own separate login template.

comment:2 by sopuch, 15 years ago

Resolution: invalid
Status: closedreopened

Ah, OK. But There isn't login.html template in registration directory. So it's not on bad place but is missing.

comment:3 by Russell Keith-Magee, 15 years ago

Resolution: invalid
Status: reopenedclosed

Omitted on purpose. We can't provide a template that will work on every site. You need to provide the template, and registration/login.html is a default suggested location.

comment:4 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

in reply to:  3 comment:5 by Yamil Jaskolowski, 6 years ago

Easy pickings: unset
Severity: Normal
Type: Uncategorized
UI/UX: unset

Replying to Russell Keith-Magee:

Omitted on purpose. We can't provide a template that will work on every site. You need to provide the template, and registration/login.html is a default suggested location.

Why exactly a login template working on every site can't be provided? I just start learning django one month ago and I reach here looking for this. I just create a 'registration/login.html' file with only one line: {% extends "admin/login.html" %} and it is working great. I don't fully understand yet how auth works but seems possible to admin/login.html can be called somehow instead extend it... or not?

comment:6 by Carlton Gibson, 6 years ago

Hi Yamil.

I can appreciate that needing to create your own templates seems a pain when you're getting up and running. It's always been this way, and I remember wanting such templates provided for me when I started too.

There's a point about this on the Django Registration FAQ:

Providing default templates with an application is ranges from hard to impossible, because different sites can have such wildly different design and template structure. Any attempt to provide templates which would work with all the possibilities would probably end up working with none of them.

If you search for "django auth templates" or "django registration templates" you can find samples on the internet, but I cannot vouch for their reliability: I advise you to use them as a guide rather than copy anything wholesale into your project.

Note: See TracTickets for help on using tickets.
Back to Top