Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4624594
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:09:05+00:00 2026-05-22T03:09:05+00:00

I am trying to create a custom profile to add additional fields to django-registration

  • 0

I am trying to create a custom profile to add additional fields to django-registration. Here is the code I have so far —

in models.py

from django.db import models
from django.contrib.auth.models import User

class Profile(models.Model):
    user = models.ForeignKey(User, unique=True)
    first_name = models.CharField(max_length=50)
    last_name = models.CharField(max_length=50)
    email = models.CharField(max_length=50)
    password = models.CharField(max_length=50) 

and in settings.py

AUTH_PROFILE_MODULE = 'myproject.Profile'

However, I am getting the following error when I try to use create_user(). Here is what happens when I type it into the interpreter —

>>> from django.contrib.auth.models import User
>>> User.objects.create_user(first_name='tom',last_name='smith',email='ts@gmail.com',password='hello')
Traceback (most recent call last):
  File "<console>", line 1, in <module>
TypeError: create_user() got an unexpected keyword argument 'first_name'

What am I missing in order for create_user() to recognize these new columns? Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T03:09:06+00:00Added an answer on May 22, 2026 at 3:09 am

    There are a number of things you’re doing wrong here

    Firstly, these aren’t fields on the User model, they’re on the Profile model. So it shouldn’t be surprising that the User manager method doesn’t recognise them. You’ll need to define a User object in the normal way with create_user, then define the Profile instance using that user.

    Secondly, create_user doesn’t take all the field names as keyword arguments – it only takes username, email and password. Again, you’ll need to set the other fields yourself afterwards.

    However, I don’t understand at all why you’ve defined these particular fields. They are all available in the built-in User model. In particular, you should definitely not be defining your own password field, unless you also write some code to store the password as a hash rather than as plain text.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom content type with custom fields. I'm trying to create a
I'm trying to create a custom Android compound view, here is the code: <?xml
I'm trying to create a custom control - a button - which will have
I am trying to create a delegate protocol for a custom UIView. Here is
I'm trying to create with Delphi a component inherited from TLabel, with some custom
I am trying to handle add a custom field to a user profile using
I'm trying to create a custom UIMenuController and display it in my view. Here's
I'm trying to create a custom view GhostSurfaceCameraView that extends SurfaceView . Here's my
I'm trying to create a custom function to take a array and add comma.
Trying to create a custom component that gets it's layout from an XML file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.