Questions tagged [django-custom-user]

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

268 questions
0
votes
1 answer

Unable to login a custom user using CBV in django

While trying my luck with Class Based views in Django, I am unable to get a custom user logged in. Here is my view: class Loginview(FormView): form_class = LoginForm template_name = 'login.html' def get(self, request, *args,…
0
votes
1 answer

Django - AttributeError

I created my custom User model. While doing migrations, I get an AtrributeError from django.db import models from time import timezone from django.contrib.auth.models import AbstractBaseUser, BaseUserManager from django.core.mail import…
Jieke Wei
  • 173
  • 2
  • 13
0
votes
2 answers

Django custom user error

I have a custom user model that extends an AbstractBaseUser, as well as my own user manager (GenericUserManager): class GenericUserManager(BaseUserManager): def create_user(self, username, email, password, key_expires): if not email: …
0
votes
2 answers

Identify type of logged in user

I have a custom user setup like this: class CustomUser(AbstractUser): pass class Employee(CustomUser): user = models.OneToOneField(settings.AUTH_USER_MODEL) # other fields In settings.py, I then add the following key: AUTH_USER_MODEL =…
Animesh
  • 4,926
  • 14
  • 68
  • 110
0
votes
1 answer

Not Found: /accounts/register/accounts/register

Page not found (404) Request Method: POST Request URL: http://127.0.0.1:8000/accounts/register/accounts/register views.py : from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect from…
0
votes
1 answer

Updating custom user profile

In my web app, I need two users, regular site users and employees. I am using a custom user based on AbstractUser to achieve this. class CustomUser(AbstractUser): pass class Employee(CustomUser): user =…
Animesh
  • 4,926
  • 14
  • 68
  • 110
0
votes
1 answer

How to create multiple types of user with custom user model in django?

I want to create multiple types of user in django app e.g one for Company and one for Employee. What I had in mind was company will signup for itself and then employees will be created by company admin through his/her dashboard. After creation…
Niraj
  • 5
  • 3
0
votes
0 answers

Getting EmailField error in CharField while submitting form in Django 1.9

I am a beginner, developing my Django project. I am trying to make my own email based authentications model. I have done some work, and successful in creating superusers and users through django admin platform and logging them in through login form…
0
votes
2 answers

how to redirect different types of pages to different users after login in django

I have created two different types of users - truck & company using Django. Here is my registration page of a user Registration Page After registering, the data about whether the user is a truck or company will go to the database. In my login page,…
vanam
  • 135
  • 1
  • 4
  • 14
0
votes
0 answers

(fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract

I am trying to create customuser for my Django project with email as username and add a radio button for truck and company. so that in the registration process email-id will be registered as per truck or company. I mentioned the radio button as…
vanam
  • 135
  • 1
  • 4
  • 14
0
votes
1 answer

Custom User Model extending AbstractUser, authenticate return None

I want create my custom user extending AbstractUser, but when i want authenticate my custom user return None. When i create CustomUser() is stored in database but the passwowrd is not encrypted. Can i use authenticate function of banckend default?…
0
votes
1 answer

Extra field in django(1.9) registration (redux) without using implementing custom user model

I am fairly new to django and this might be a basic level question for someone experienced but any help will be greatly appreciated. I am trying to create a custom registration form for the user using django-registration-redux package. I have the…
0
votes
1 answer

How to change the name of db column last_login created by custom Django user?

I've created a custom User in Django and added some extra fields to UserProfile model. I want to keep all column names without underscore but last_login filed is getting created by base User. After running migrations, the only column which appears…
Sanchit
  • 412
  • 2
  • 8
  • 22
0
votes
2 answers

Can't login with user created on custom form - Django

I have written a custom form for the creation of a user. The login works for the users created on the terminal with "python manage.py createsuperuser", but it doesn't work for the users created on the website. I have checked, and the creation form…
0
votes
0 answers

Regular custom users able to login to Admin console of Django

I created a custom user model for Django, and now these regular users are able to login to the Admin console. My custom user model is extending AbstractBaseUser and my custom user manager sets class CustomUserManager(BaseUserManager): def…
1 2 3
17
18