Try
{% if form.errors %}
<p>Your username and password didn't match.
Please try again.</p>
{% endif %}
On Oct 1, 10:53 pm, F Pighi <[EMAIL PROTECTED]> wrote:
> Hello folks, in these days I'm trying to learn a little bit of Django
> for an imminent project.
> I'm following the book titled "Learning website development with
> Django" by Packt, but I've got some problems at chapter 4 with the
> login process.
> The following is the url.py file:
>
> from django.conf.urls.defaults import *
> from bookmarks.views import *
>
> urlpatterns = patterns('',
> (r'^$', main_page),
> (r'^user/(\w+)/$', user_page),
> (r'^login/$', 'django.contrib.auth.views.login'),
> )
>
> and this is the template registration/login.html:
> <html>
> <head>
> <title>Django Bookmarks - User Login</title>
> </head>
> <body>
> <h1>User Login</h1>
> {% if form.has_errors %}
> <p>Your username and password didn't match.
> Please try again.</p>
> {% endif %}
> <form method="post" action=".">
> <p><label for="id_username">Username:</label>
> {{ form.username }}</p>
> <p><label for="id_password">Password:</label>
> {{ form.password }}</p>
> <input type="hidden" name="next" value="/" />
> <input type="submit" value="login" />
> </form>
> </body>
> </html>
>
> The problem is that whenever i click on the Login submit button the
> browser makes a POST (Firefox want to save the username and password)
> but it then returns on the same page with the fields populated. It's
> like nothing happened.
>
> Anybody can help a n00b? :)
>
> Thank you in advance!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---