Hi,

I was trying to add a Customised View to Handle Wrong Passwords entered by 
Users.

As of now, Djangos Framework just outputs, "Invalid Username or Password" 
when a Wrong password is entered by the User.

This doesnt allow much flexibility if some information such as Invalid 
Access needs to be Logged.
Thus it would be good to Redirect these into a Customized view where the 
Logging of such information can be done and then redirected back to the 
Login page with Error.

Any Ideas on how easily this can be done ?

I tried adding a View when a Wrong password is called but always ended up 
in the below Error:

  File "/usr/lib/python2.7/site-packages/django/core/urlresolvers.py", line 
578, in reverse
    return force_text(iri_to_uri(resolver._reverse_with_prefix(view, 
prefix, *args, **kwargs)))
  File "/usr/lib/python2.7/site-packages/django/core/urlresolvers.py", line 
495, in _reverse_with_prefix
    (lookup_view_s, args, kwargs, len(patterns), patterns))
NoReverseMatch: Reverse for '' with arguments '()' and keyword arguments 
'{}' not found. 0 pattern(s) tried: []


The login.html looks as simple as this.
td>{{ form.password }}
                                {% if form.password.errors %}
                                      <div id="password_error_div" 
class="error">You must specify a password.</div>
                                  {% endif %}
                                  

*{% if form.non_field_errors %}                                  <div 
id="password_error_div" class="error">Invalid username or 
password.</div>                                  {% endif %}*
                          </td>
In the Highlighted case, i would like to handle the Error, Log the 
information to a file required and return back to the page.

Any Help on how this can be done would be great.
Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/68866d38-d5e4-4aa6-a352-4c352d2b04b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to