Questions tagged [django-users]

User model is the default model in Django. It provides many APIs which are helpful for working with users. Django user model is overridable in a Project according to required field.

Django(a high-level Python Web framework) comes with a user authentication system. It handles user accounts, groups, permissions and cookie-based user sessions.

894 questions
2
votes
2 answers

Error while logging in when primary key of Django `User` is a `CharField`

I wanted to use a CharField as primary key for Django User and add some extra fields to it. So, I extended AbstractUser model as given below: class User(AbstractUser): id = models.CharField(primary_key=True, max_length=32,…
Prashant Borde
  • 1,058
  • 10
  • 21
2
votes
2 answers

Django user accounts, extending accounts

I am trying to extend Django's user-accounts Account model to add to it a set of additional fields. The thing is that "Account" objects have a set of methods that check some parameters and I would like to re-use all that code. Therefore, the first…
nsx
  • 697
  • 1
  • 13
  • 41
2
votes
1 answer

In Django custom user manager, difference between create_user and _create_user()?

I'm trying to work through the tutorials for a Django custom user manager. Most of them override create_user() and create_super_user() like the documentation says to do, but this tutorial leaves those two methods alone and instead overrides…
aris
  • 22,725
  • 1
  • 29
  • 33
2
votes
1 answer

Pulling a username - 'ManyRelatedManager' object does not support indexing

I'm creating on a website that allows users to play an asynchronous game. I'm running Django 1.5 with Python 2.7.5, and using Django's native user authentication API. Rather than create a custom User model, I've linked each user to a custom…
2
votes
1 answer

Generating unique usernames from an email list for creating new users in django application

I am importing contacts from gmail. c_lst is the list that has the names and email address in a dictionary as follows - [{'name': u'fn1 ln1', 'emails': [u'email1@gmail.com']}, {'name': u'fn2 ln2', 'emails': [u'email2@gmail.com']},. There are two…
user1629366
  • 1,931
  • 5
  • 20
  • 30
2
votes
1 answer

Django IntegrityError 1452

I had an application that was working nicely using a User class that I had defined. After working on this for a few weeks, I realized I needed user authentication, and decided to use django's User class instead (I didn't really understand how this…
Daniel Rosenthal
  • 1,386
  • 4
  • 15
  • 32
2
votes
1 answer

Backwards many-to-many relationship with Proxy models in Django

I have a model name 'Group' with a ManyToMany relationship with the Django User, and a 'Membership' table between. class UserManager(models.Manager):get_query_set(self): return super(UserManager,…
lracicot
  • 364
  • 2
  • 15
2
votes
2 answers

Django problems with id in custom UserModel

I need to use user_id instead id in my custom user model(don't ask why, it's a long story :)). I try to use code from django example, but when it I tried to log in into admin backend, I got In template…
Andrii Rusanov
  • 4,405
  • 2
  • 34
  • 54
2
votes
1 answer

Django : how to Identify who is saving the model from program?

How do I check from the django code, which User is saving a model currently ? I need to throw Validation Errors or assign some permissions to him from that.
Deepankar Bajpeyi
  • 5,661
  • 11
  • 44
  • 64
2
votes
1 answer

Django: How can i get the logged user outside of view request?

I have a class method (outside of a view) who needs the logged user's information. How can i retrieve the logged in user without passing the request to the method? Unfortunately i can't find nowhere a nice solution and it's not logical just not…
CodeArtist
  • 5,534
  • 8
  • 40
  • 65
2
votes
2 answers

Django user registration validation not working

Hello i want to develop validation to user registration if user exists and is password matches the password confirmation field. Unfortunately, validation doesn't works. For example, if the 2 passwords don't match, the registration completes anyway…
Dimitris
  • 403
  • 2
  • 8
  • 17
2
votes
3 answers

Django-Userena email backend

I am trying to set up Django-Userena. I have added the following line to settings.py file: EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend' Also tried with: EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' When trying to…
Ramona
  • 19
  • 2
2
votes
2 answers

Captured URL parameters in form

I am using Userena and I am trying to capture URL parameters and get them to my form but I'm lost how to do this. What I would like to do in my template is: Free Plan
Cliff Helsel
  • 920
  • 1
  • 12
  • 26
2
votes
2 answers

Django Userena Extending

I am trying to implement the concept of "Plans" (free, pro, enterprise, etc.) when a user signs up for my site. I am beginning Python & Django. I've gotten django-userena installed and working. Now, I am trying to extend the behavior to allow a user…
Cliff Helsel
  • 920
  • 1
  • 12
  • 26
2
votes
1 answer

Getting user logged in with django-social-auth

I set up a unit test as such: class UserViewTests(TestCase): def setUp(self): self.user_passwords = '123456' self.user1 = User.objects.create(username='Bobby Johnson', password=self.user_passwords) ... def…