Questions tagged [django-auth-models]

39 questions
1
vote
1 answer

how do i set my authentication backend as default in settings.py file of my django project(Extended AbstractBaseUser model)

I have written the following class for Auth Back end and placed it inside a file "authentication.py" inside the app directory: from events.models import User class authBackend(): def authenticate(self, request, username, passwprd): …
1
vote
2 answers

Adding "group" field in Django User Admin

I am trying to add a "group" field to show group permissions on the user panel in Django 3.1.2. I tried combining this and this, but always end up in either The model User is already registered with 'auth.UserAdmin' or The model User is not…
xtlc
  • 1,070
  • 1
  • 15
  • 41
1
vote
1 answer

Failed to setup settings.AUTH_USER_MODEL in Django

Previously, I failed to setup the AUTH_USER_MODEL = 'apps.authuser.User' for my project. All my apps is combined in one folder, called with apps. the project structure is like this; ├── apps │   ├── authuser/ │   │   ├── __init__.py │   │   ├──…
1
vote
0 answers

How to Give Permission in Django?

I am working on Django and I create my Custom Admin Panel, But I want the same functionality of permission like as Django Default admin Panel. I create functionality for the Blog model in my Dashboard, if I log in as a super-admin and I give Normal…
1
vote
1 answer

Django Extended Group's Permissions not applied to users

So I have extended Django's Group model to add an extra field like so: class MyModel(Group): extra_field = models.TextField(null=True, blank=True) On doing this, each instance of MyModel created, creates a Group instance as well. If I add a…
söze
  • 500
  • 1
  • 3
  • 13
1
vote
0 answers

Django : edit profile using AbstractBaseUser

in my django project, I use AbstractBaseUser to register a new user. I use set_password to define his password for it to be encrypted. Now I want to create a view for editing a profil. I want the password to be able to be change and to be…
Bastien
  • 1,447
  • 3
  • 9
  • 19
0
votes
0 answers

Django allauth: Multiple user registration with email-only authentication causing UNIQUE constraint error

I have an issue with a django allauth project I typed that in settings.py to disable username field and use email address SOCIALACCOUNT_QUERY_EMAIL = True ACCOUNT_LOGOUT_ON_GET= True ACCOUNT_UNIQUE_EMAIL = True ACCOUNT_AUTHENTICATION_METHOD =…
0
votes
0 answers

Django 'function' object has no attribute 'objects' - django.contrib.auth.models

I cannot insert value in the watchlist table because the user foreign key problem. models.py from django.db import models from django.contrib.auth.models import User class watchlist(models.Model): watchlist_id =…
0
votes
0 answers

google 0Auth screen authentication not appearing after deploying my django web aplication in pythonanywhere

google 0Auth screen I already finished my django web app for my capstone project. This application use google drive API, my google drive will serves as the storage for the files that will be uploaded by the users. It is working fine on my local…
0
votes
1 answer

Django returns session id but doesn't authenticate user

I have the following code that sends requests to check JWT token, then authorize user and return authorized session with Access token, Refresh Token and Session ID. @csrf_exempt def new_login_view(request, *args, **kwargs): def…
0
votes
1 answer

How can I do authentication on the site and the built-in Users model and my own Employer Django?

I ran into a problem I am making a job search site on Django, I have the following logic: Authorization and authentication of ordinary job seekers using Django's built-in model - User Also separate authorization and authentication for users who…
0
votes
1 answer

How to login to Django Admin panel with user I created in this panel? User model was extended

The model itself: from django.db import models from django.contrib.auth.models import AbstractUser class UserModel(AbstractUser): class UserType(models.TextChoices): MANAGER = 'm', 'Manager' CUSTOMER = 'c', 'Customer' …
0
votes
0 answers

UserProfile not creating in custom model using User model as OneToOneField(User)

I am creating the super user through admin panel or command line, but it is not showing in the custom model in the database. models.py from django.db import models from django.contrib.auth.models import User # Create your models here. class…
0
votes
0 answers

Add more fields to auth User model and then use it for authentication in Django

I want to add more fields to auth User model and then use it for registration,login and logout . For example i need an image field to store profile picture and an interger/date field to store date of birth . I having hard time understanding the…
0
votes
1 answer

Can't change user password for Django user model using ModelViewSet

I was using Django user model using the ModelViewSet. When I am making a request to update the password for the current user that is logged in. Although I get a 200 OK response but my password never changes to the new one that I changed. I also…