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 728621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:42:08+00:00 2026-05-14T06:42:08+00:00

I am writing simple site that requires users and profiles to be handled. The

  • 0

I am writing simple site that requires users and profiles to be handled. The first initial thought is to use django’s build in user handling, but then the user model is too narrow and does not contain fields that I need. The documentation mentions user profiles, but user profiles section has been removed from djangobook covering django 1.0 (ideally, the solution should work with django 1.2), and the Internet is full of different solutions, not making the choice easier (like user model inheritance, user profiles and django signals, and so on).

I would like to know, how to write this in good, modern, fast and secure way. Should I try to extend django builtin user model, or maybe should I create my own user model wide enough to keep all the information I need? Below you may find some specifications and expectations from the working solution:

  • users should be able to register and authenticate
  • every user should have profile (or model with all required fields)
  • users dont need django builtin admin panel, but they need to edit their profiles/models via simple web form

Please, let me know how do you solve those issues in your applications, and what is the best current way to handle users with django. Any links to articles/blogs or code examples are highly appreciated!

  • 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-14T06:42:09+00:00Added an answer on May 14, 2026 at 6:42 am

    users should be able to register and authenticate

    django.contrib.auth is the module you want. Be sure to check the docs for custom login forms.

    every user should have profile (or model with all required fields)

    You need to set settings.AUTH_PROFILE_MODULE, as noted by others.

    Information about setting up the user profile model is available for the latest version, 1.1, and 1.0. It hasn’t been dropped.

    users dont need django builtin admin panel, but they need to edit their profiles/models via simple web form

    You can create a form and view just like you would for any other app; maybe make a “user control panel” app for handling these things. Your views would then interact with the django.contrib.auth.models.User and django.contrib.auth.models.Group models. You can set this up to do whatever you need.

    EDIT: Responding to your questions-in-the-form-of-an-answer (paging Alex Trebek)…

    The second version of djangobook, covering django 1.0 (that is way closer to 1.2 than 0.96) no longer has that information anywhere, what makes me highly confused – has anything changed? Is there other, better, more secure way to handle users and their profiles? Therefore this question asked.

    I wouldn’t recommend djangobook as a reference; it’s out of date on this topic. User profiles exist and I’m using them in my Django 1.1.1 site; I’m even populating them from NIS.

    Please use the links I provided above. They go directly to the actual Django documentation and are authoritative.

    By the way, I forgot to ask, if the way you all refer to (that is AUTH_PROFILE_MODULE) will create automatically upon registration

    Answered in the docs.

    and require the profile to exist upon any action (user withoud existing, filled profile should not exists, this is why I was thinking about extending User model somehow)?

    The profile needs to exist if User.get_profile() is called.

    Will it get updated as well (people are mentioning ‘signals’ on various blogs related to this subject)?

    It’s like any other model: it only gets updated when you change the fields and call save().

    The signal part is how you hook in a function to create a profile for a new User:

    from django.db.models.signals import post_save
    from django.contrib.auth import User
    from myUserProfileApp import UserProfile
    
    def make_user_profile(sender, **kwargs):
        if 'created' not in kwargs or not kwargs['created']:
            return
    
        # Assumes that the `ForeignKey(User)` field in "UserProfile" is named "user".
        profile = UserProfile(user=kwargs["instance"])
        # Set anything else you need to in the profile, then...
        profile.save()
    
    post_save.connect(make_user_profile, sender=User, weak=False)
    

    This only creates a new profile for a new User. Existing Users need to have profiles manually added:

    $ ./manage.py shell
    >>> from django.contrib.auth import User
    >>> from myUserProfileApp import UserProfile
    >>> for u in User.objects.all():
    ...  UserProfile(user=u).save() # Add other params as needed.
    ...
    

    If you have some users with profiles and some without, you’ll need to do a bit more work:

    >>> for u in User.objects.all():
    ...  try:
    ...   UserProfile(user=u).save() # Add other params as needed.
    ...  except:
    ...   pass
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a simple news site. I want that the URL will be something
I am writing a site, which provides a simple users implementation. The users table
I'm writing a django model that allows my site to have coupons. Coupons can
I'm writing a simple web-based site for a company to display products on their
I'm writing a web site (C#, ASP 3.5) while implementing a simple CMS. In
I'm writing simple filter in Android and want to use ExpandableListAdapter with check boxes.
I have a really simple site that I created. I am trying to test
I am writing a simple form submit function for a specific site. The script
I have a website (python/django) that needs to use a load of Java resources
I have a simple site on a shared hosting service and I use basic

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.