django-users Questions

3

In order to create a new user model in Django 1.5.x, there are two approaches: Inherit AbstractUser class which is the default user model you get, this way you can extend it with any attributes y...
Dextrocular asked 12/9, 2013 at 16:34

3

Solved

I am using the inbuilt password reset functionality of Django which emails the user the password reset link. Is there an option in Django to set an expiration time to the link suppose 6 hours after...
Succory asked 16/1, 2014 at 7:1

4

Solved

I'm coding a web app with django and now I'm starting to handle users. I'm trying to do the easy part, just create a new user throught admin interface, but when I try to do it I get a error and I d...
Hereinafter asked 31/5, 2015 at 10:57

2

This may sounds a stupid question but I have difficulty deleting users in django using this view: @staff_member_required def del_user(request, username): try: u = User.objects.get(username = u...
Osugi asked 15/11, 2015 at 2:53

5

Solved

I am just using the admin site in Django. I have 2 Django signals (pre_save and post_save). I would like to have the username of the current user. How would I do that? It does not seem I can send a...
Minstrel asked 18/1, 2011 at 8:9

17

Solved

What's the best way to extend the User model (bundled with Django's authentication app) with custom fields? I would also possibly like to use the email as the username (for authentication purposes)...

4

Note: If you are tempted to 'answer' this question by telling me that you don't like django.contrib.auth, please move on. That will not be helpful. I am well aware of the range and strength of opin...

4

Solved

I have my own custom User model, and its own Manger too. models: class MyUser(AbstractBaseUser, PermissionsMixin): email = models.EmailField(max_length=255, unique=True) first_name = models.Ch...
Passional asked 12/11, 2015 at 14:56

6

Solved

I'm new to django and I'm facing some difficulties in creating a user from the AbstractBaseUser model. Now I'm starting wondering if my user model is not being build in the right way. This is my Us...
Aldosterone asked 18/9, 2016 at 15:56

5

Solved

The use of AbstractUser and AbstractBaseUser looks quite similar. from django.contrib.auth.models import AbstractUser, AbstractBaseUser What is the difference between the two?
Sutphin asked 2/2, 2014 at 18:18

4

Solved

I want to add a new function to the default User model of Django for retrieveing a related list of Model type. Such Foo model: class Foo(models.Model): owner = models.ForeignKey(User, related_na...
Voyageur asked 30/5, 2010 at 19:13

2

Solved

I setup if statement to see if the current user has a password set. For some reason it just won't work. I have tried: {% if not user.password %} {% if user.password == None %} {% if user.password ...
Ytterbia asked 22/6, 2013 at 11:27

5

i'm building a web application with Django 1.5. I'm using a custom User model with a custom UserManager. I followed the instructions and examples of the official Django documentation. Now, when i...
Dwan asked 17/5, 2013 at 9:59

3

Solved

I'm currently working on a Django app, and I'm trying to set the current user as default on a model, but it doesn't work. created_by = models.ForeignKey(User, default=request.user, null=True, bla...
Feodora asked 18/10, 2018 at 10:27

3

Solved

I've created a user-signup page which adds users to User Model in Django But when the data is saved, the Password is not encrypted, i.e. stored as Text only. This creates a problem when the user tr...

1

Note my question is similar to this one, however that answer recommend not calling the customised user model User, whereas the official docs and this issue do. I created a custom User model in an a...
Enallage asked 6/8, 2021 at 11:33

7

Solved

I have the following method: def _attempt(actor): if actor.__class__ != User: raise TypeError Which is called from a view: self.object.attempt(self.request.user) As you can see, the _attemp...
Selfdeceit asked 3/7, 2012 at 16:6

1

In Django, I am trying to move a custom User model from one app to another. When I follow instructions such as found here, and try to apply the migration, I get errors with ValueError: Related mode...
Heffernan asked 6/10, 2021 at 22:9

2

Solved

I'm listing registered users on a ListView page and I'm trying to show if user is superuser or not. My main user is created with python manage.py createsuperuser command and I'm sure it is a superu...
Hairstreak asked 23/12, 2020 at 9:0

2

Solved

I have a group EuropartsBuyer and model named Product. The following code adds a permission to the Product model. class Meta: permissions = ( ("can_add_cost_price", "Can add cost price"), ) ...
Taratarabar asked 6/2, 2017 at 8:26

3

Solved

I am trying to implement my own custom user model in Django 1.6 but I am getting this error. Traceback (most recent call last): File "./manage.py", line 10, in <module> execute_from_comman...
Ophicleide asked 11/8, 2014 at 8:46

4

Solved

I am looking a way to get all the attributes of a variable after we set the value in it using queryset. For example...refer below code... using user.id or user.first_name i can get the value for t...

4

Solved

I just want to add the subscription date in the User list in the Django CRUD Administration site. How can I do that ? Thank you for your help
Otology asked 16/2, 2010 at 3:59

3

Solved

I noticed looking through the django-allauth templates there's a signup_closed.html users can be redirected to when user registration is closed or disabled. Does anyone who's familiar with that mod...
Inutility asked 29/7, 2013 at 12:12

2

I have some question In a project I have the need of work with users which are of three (may be more) types of them have different roles: physician patient administrator I have been thinking use o...
Banns asked 30/10, 2015 at 21:40

© 2022 - 2024 — McMap. All rights reserved.