Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#12138 closed (invalid)

django.contrib.auth assumes all applications are hosted in their top level package

Reported by: tiberiu_ichim Owned by: nobody
Component: Uncategorized Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


File "django/contrib/auth/", line 283, in get_profile has

app_label, model_name = settings.AUTH_PROFILE_MODULE.split('.')

What if I want my AUTH_PROFILE_MODULE to be

AUTH_PROFILE_MODULE = 'pinax.apps.basic_profiles.Profile'

Of course, it's not possible. Seems like a basic design mistake of that piece of code.

Change History (4)

comment:1 Changed 6 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

There's no design mistake here. You need to use AUTH_PROFILE_MODULE="basic_brofiles.Profile", since that is how Django's app index will identify the model. This is exactly what the documentation tells you to do.

comment:2 Changed 6 years ago by tiberiu_ichim

I appreciate the time taken to point me to the docs. Then, should the ticket be something like "Django only understand applications that are top level packages, not subpackages" ? Nevermind the concept of (setuptools) namespaces...

comment:3 Changed 6 years ago by carljm

No, because that's not true either. Your application would be in INSTALLED_APPS as "pinax.apps.basic_profiles" and your AUTH_PROFILE_MODULE would still be "basic_profiles.Profile". Please take support issues to the mailing list or IRC, not the bug tracker.

comment:4 Changed 6 years ago by adamnelson

Nonetheless, the OP has a point that the cryptic error message and no clear statement in the docs that AUTH_PROFILE_MODULE has to have one an only one dot are needlessly difficult to divine for a new Python programmer.

Note: See TracTickets for help on using tickets.
Back to Top