2
It was all because of Django’s built-in CSRF system: https://docs.djangoproject.com/en/dev/ref/contrib/csrf/
1
Well, one thing you do is
from django.contrib.auth import authenticate,login,logout
and then redefine login
def login(request):
and then call the other one again, which is not reachable anymore (overwritten by your own login function).
login(request, user)
Not sure though if that’s causing the error though.
- [Django]-Django list of ids as a form field
- [Django]-Django Application: Foreign Key pointing to an abstract class
- [Django]-Exclude on a many-to-many relationship through a third table
- [Django]-Return object when aggregating grouped fields in Django
0
Also, the line:
return User.objects.get(email_address=email_address, password=password)
implies that the User record stores the password as-is, in plaintext. Whereas, in fact, it stores a salted hash of the password, so you might need to implement all that functionality yourself.
- [Django]-DJANGO CHECK CONSTRAINTS: SystemCheckError: (models.E032) constraint name 'age_gte_18' is not unique amongst models
- [Django]-Django: Safely validating untrusted HTML input
- [Django]-Where and how to configure django-cms's djangocms_text_ckeditor to strip <p> tags?
- [Django]-Fire Django Signal's from the command line
- [Django]-Does any one know of an RTF report generator in Django?
Source:stackexchange.com