Questions tagged [django-custom-user]

Tag for questions related to custom User model functionality introduced in Django 1.6

268 questions
5
votes
1 answer

How to fix "TypeError: argument of type 'ConnectionHandler' is not iterable" when running a django test?

When I do ```python -m unittest`` inside of my users app, I get this error: TypeError: argument of type 'ConnectionHandler' is not iterable I was customizing my User model in django and I wanted to make a test for it. I already did the migrations…
5
votes
1 answer

Django Creating a Custom User with the Django Rest Framework

I'm trying to create a custom user using the Django Rest Framework. I got it to the point to where I can create a regular user, but I'm unsure on how to extend it to the custom user model. models.py: from django.db import models from…
Evan Bloemer
  • 1,051
  • 2
  • 11
  • 31
4
votes
2 answers

Add user to a group at signup in Django

New to Django here. There are three types of users: Bronze, Silver and Gold with different permissions. All users start out as Bronze when they sign up and then move upwards when they fulfill certain conditions. Therefore I tried to customize the…
user1933205
  • 300
  • 4
  • 12
4
votes
4 answers

Wagtail: Add image to custom user model

I'm following the Wagtail documentation to customize the user model. I want to add an image to the user model. Django version: 2.0.8, Wagtail version: 2.1 Problem After choosing an image with the image chooser field and clicking 'Save', this error…
4
votes
1 answer

Attribute error: 'User' object has no attribute 'is_admin'

I have customized user model by extending AbstractBaseUser, the user name only accepted as email id. Here is the model: class User(AbstractBaseUser, PermissionsMixin): email = models.EmailField('email address', unique=True) first_name =…
bSr
  • 1,410
  • 3
  • 16
  • 30
4
votes
1 answer

Django: is extending AbstractBaseUser required to use email as USERNAME_FIELD?

Like many others, I'm trying to configure my Django app to use the email as the username field. I have some existing user accounts that I migrated to a custom user model successfully, though right now the custom model is identical to the Django user…
dkhaupt
  • 2,220
  • 3
  • 23
  • 37
4
votes
1 answer

heroku: relation "auth_group" does not exist

I'm facing problem while doing syncdb on heroku. I have a custom user model and when I try to sync,heroku gives this error. django.db.utils.ProgrammingError: relation "auth_group" does not exist I tried python manage.py makemigrations but nothing…
S7H
  • 1,421
  • 1
  • 22
  • 37
4
votes
2 answers

AppRegistryNotReady error with django 1.7 and custom User

I am creating a custom django user and I get the following error when trying to use it. The error I get is the following AppRegistryNotReady: Models aren't loaded yet. My model class MyCustomUserManager(BaseUserManager): def create_user(self,…
Apostolos
  • 7,763
  • 17
  • 80
  • 150
4
votes
1 answer

Migrating from auth.User to custom user model. Groups and permissions are always empty

I'm migrating my app from Django 1.4 to Django 1.7. I have already upgraded all third party libraries and Django itself. No errors and warnings on running manage.py check or when using manage.py runserver'. Now I want to move to a custom user model.…
Ania Warzecha
  • 1,796
  • 13
  • 26
4
votes
2 answers

Extend Django user model with custom fields, receivers and backend

I am designing a Django application (v1.6) and need to do several things with users: Add custom fields, such as a foreign key for user department Trigger database changes when certain fields change. For example, when the user's department changes I…
3
votes
2 answers

signal for custom user registration in django

help please !! I have a custom user model that I am using in my project. And I create a wallet to my new users by using signal, when they register. @receiver(post_save, sender=User) def create_saving_wallet(sender, instance, **kwargs): [...] In…
kamdaou
  • 97
  • 1
  • 8
3
votes
1 answer

Cannot assign "...'": "..." must be a "User" instance

models.py for assistance class AssistanceQuest (models.Model): Customer = models.ForeignKey(settings.AUTH_USER_MODEL,on_delete=models.CASCADE,blank=True,null=False) Status = models.BooleanField(default=False,null=False,blank=False) …
3
votes
4 answers

Can't login to Django Admin with custom User Model

I create a custom model for User, By this I can create superuser from command line, and its create successfully. But when I trying to login to Django admin with created Super user its show me This error @property def is_staff(self): return…
3
votes
1 answer

create_user() missing 1 required positional argument: 'username'

I deleted username field because I wanted user to be able to login with their email address, so I have this in my models.py : class CustomUser(AbstractUser): USER_TYPE = ((1, 'HOD'), (2, 'Staff'), (3, 'Student')) username = None email =…
3
votes
2 answers

Group and Permissions Assignment Missing when using Custom User Model

I am building an app with multiple roles defined through Django Groups. I started with a custom user model, defined as below. I am seeing a weird difference in the groups and permissions use when using a custom user model, like the inheritance is…
1
2
3
17 18