Hi,
I created a backends.py in my project folder.
backends.py ::
*from django.conf import settings*
*from django.contrib.auth.models import User*
*
*
*class EmailOrUsernameModelBackend(object):*
*def authenticate(self, username=None, password=None):*
*if '@' in username:*
*
As you can see in the views.py I did import the class *
EmailOrUsernameModelBackend.*
*
*
Now when I used " *user =
EmailOrUsernameModelBackend().authenticate(username=username,
password=password) *"
It gave an error saying:
AttributeError at /tangle/auth/
'User' object has no attribute 'backen
Sorry. The error was:
AttributeError at /authentication/
'User' object has no attribute 'backend'
--
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
Hi,
I defined a model which has a 'ForeignKey' to the 'User' .
models.py :
*class Design(models.Model):*
* title = models.CharField(max_length=100)*
* designer=models.ForeignKey(User)
*
* description = models.TextField(null = True)*
* def __unicode__(self):*
* return self.title*
*
*
forms.py :
This helped alot and solved the issue.
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, s
That worked. Thanks alot.
--
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-
6 matches
Mail list logo