#10306 closed (fixed)
login.html example FORM tag is wrong in http://docs.djangoproject.com/en/dev/topics/auth/
Reported by: | jkafader | Owned by: | Kevin Kubasik |
---|---|---|---|
Component: | Documentation | Version: | 1.0 |
Severity: | Keywords: | kkmegapatch | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hi I just thought I'd pass this along:
the ACTION parameter on the FORM tag for your sample login.html template is almost certainly wrong. It should not be '.' -- I'm not an expert on FORM ACTION but I think it should instead be , which at least worked for me.
This cost me, actually, about an hour of development time, thinking there was something drastically wrong with the way I was passing or handling the ?next= parameter in my login form. You see, an action of '.' cuts off the GET CGI string, making your form unable to redirect properly (django.contrib.auth.views.login gets the 'redirect_to' variable from the GET string, not from POST), but still, confusingly, logging in the user correctly.
This really took up a lot of time to figure out, I guess I should have gone with my original instinct of action="" with my login.html rather than slavishly copying the one in the docs. But I just thought I'd let you know about an unnecessary gotcha.
--james
Attachments (2)
Change History (12)
comment:1 by , 16 years ago
comment:3 by , 16 years ago
milestone: | → 1.1 |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:4 by , 16 years ago
Has patch: | set |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Simply use:
<form method="post" action="{% url django.contrib.auth.views.login %}">
comment:5 by , 16 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:6 by , 16 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Please don't mark tickets as fixed until the change actually gets checked into Django.
comment:7 by , 16 years ago
Triage Stage: | Ready for checkin → Accepted |
---|
comment:8 by , 16 years ago
Keywords: | kkmegapatch added |
---|---|
Owner: | changed from | to
Status: | reopened → new |
comment:9 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
sorry the above should read "It should not be '.' -- I'm not an expert on FORM ACTION, but I think it should instead be "" (empty string), which at least worked for me." I think the "" (empty string) double single quotes got stuck in the wiki formatting filter.
---james