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

  • Home
  • SEARCH
  • 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 8422251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:23:41+00:00 2026-06-10T03:23:41+00:00

I am customizing the django user module and adding some extra fields my model

  • 0

I am customizing the django user module and adding some extra fields

my model is looking like

class Drinker(models.Model):
    user = models.OneToOneField(User)
    birthday = models.DateField()
    name     = models.CharField(max_length = 100)

    def __unicode__(self):
        return self.name

And here is my register view

def DrinkerRegistration(request):
    if request.user.is_authenticated():
        return HttpResponseRedirect('/profile/')
    if request.method == "POST":
        form = RegistrationForm(request.POST)
        if form.is_valid():
            user = User.objects.create(username = form.cleaned_data['username'],email = form.cleaned_data['email'],password = form.cleaned_data['password'])
            user.save()
            drinker = Drinker(name = form.cleaned_data['name'],birthday = form.cleaned_data['birthday'],user=user)
            drinker.save()
            return HttpResponseRedirect('/profile/')
    else:
        form = RegistrationForm()
        context = {'form':form}
        return render_to_response('register.html',context,context_instance = RequestContext(request))

Now my question is when the user is registering in my auth_user table the password is storing in plan text i.e causing

Unknown password hashing algorithm '123'. Did you specify it in the PASSWORD_HASHERS setting?

error at the time of login

but for superusers passwords are in SHA1 format (i am not sure ) in auth_user table and they are able to login

please suggest me how to hash the password field here?

  • 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-06-10T03:23:43+00:00Added an answer on June 10, 2026 at 3:23 am

    Do not use User.objects.create(), use User.objects.create_user() – it will hash provided password using correct algorithm.

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

Sidebar

Related Questions

I'm trying to customize the Django Admin. models.py ============= class Question(models.Model): poll = models.ForeignKey(Poll)
Customizing a queryset of a form field in Django isn't a hard job. Like
I am customizing the index form in active admin. I have some columns like:
We are customizing workflow approval form to display the associated list item fields. This
I have a problem customizing my AQGridViewCell. I'd like to have the whole cell
I have a problem in customizing labels in a Django form This is the
I tried the new Customizing API for iOS 5 and have some problems I
I'm customizing django comments. According to the docs you'll need to add your customized
I'm customizing MS Dynamics CRM 4 and I have some JScript running on the
I'm customizing the product view page and I need to show the user's name.

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.