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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:36:28+00:00 2026-06-02T09:36:28+00:00

Up until recently, a project I’m working used one mega UserProfile to handle all

  • 0

Up until recently, a project I’m working used one mega UserProfile to handle all profile data for two different types of users. Naturally this was messy, and it was about time to refactor it.

In my attempt to refactor the model, I split the model into Requester and Funder and created an abstract UserProfile model which both subclass:

class UserProfile(models.Model):
  class Meta:
    abstract = True

  user = models.OneToOneField(User)

  def __unicode__(self):
      return unicode(self.user)


class Requester(UserProfile):
  def requested(self, event):
    """Check if a user requested an event."""
    return self == event.requester


class Funder(UserProfile):
  osa_email = models.EmailField(null=True) # The e-mail of the contact in OSA
  mission_statement = models.TextField(max_length=256)

And in my settings.py file, I adjusted the AUTH_PROFILE_MODULE.

AUTH_PROFILE_MODULE = "app.UserProfile"

The problem is, when hitting a page that uses “User.get_profile()” it breaks, reporting:

Unable to load the profile model, check AUTH_PROFILE_MODULE in your project settings

I’m not quite sure what’s going on here. According to the docs, everything looks right.

Can some explain why this fails? (There are a bunch of alternative solutions I’ve come across, but I’d much prefer to fix this if possible than adopt some hack.)

  • 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-02T09:36:29+00:00Added an answer on June 2, 2026 at 9:36 am

    What you are trying to do it not possible. AUTH_PROFILE_MODULE is expecting a concrete model, not an abstract one. Concrete means it has a table and can create instances. An abstract model can only be subclassed.

    A logic reason why this not possible it that django has no one of knowing which model instance to return for your user. A Requester? A Funder? Simply being an abstract reference gives django no hints. One approach might be to look into the contenttypes framework and maybe come up with a generic UserProfile model containing a reference to the proper sub-profile type. You could then remove the abstract=True from your UserProfile, and create a generic relation to the specific Profile model. AUTH_PROFILE_MODULE would then simply reference that single UserProfile, but its instances can then use the .content_object to get the specific subobject.

    There are many ways I’m sure you could address this problem, but I am just commenting on the reason why this specific approach does not work.

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

Sidebar

Related Questions

Until recently I was a read-only user of an open-source project on GoogleCode. I've
Until recently it was simple to read all the SVN:Externals referenced in a subversion
I had never tried Continuum as a build server until recently when a project
Not really sure what happened here, as Devise was working until recently. In a
While recently imported a new project into eclipse, at one point when I tried
The project I'm working on recently made a big effort to cleanup the code
I've been working on a project in Eclipse that uses the Accurev VCS. Until
I recently started using Git when creating a new project - until then I
Until now, my project had only .cpp files that were compiled into different binaries
I recently was working on a little python project and came to a situation

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.