Sunday, April 28, 2013

Re: Must AUTH_USER_MODEL be in ""?

Thanks for the reply,

I used the "import *" syntax for brevity in my post, my actual code uses the "from .app1 import MyThing" syntax.

I added "from project.app1._models.model1 import MyUser" to the, and I get the same issue.

The only workaround I've found is to make "MyUser" abstract, then in create a concrete implementation of it.

Do you think I should report this issue as a bug, or is this behaviour by design?

On Sunday, 28 April 2013 08:32:46 UTC-6, François Constant wrote:
I wouldn't use "import *" if I were you. I would put the imports in the file rather than in _models/

Not sure if that will save your problem but might be worth trying it out.

On Sunday, 28 April 2013 17:17:07 UTC+10, Richard Eames wrote:
I like to split my models up into separate files, but it seems that the new customizable user model requires that it is defined directly in a "" file. 

A condensed version of my project structure and code:
   app1/ "from _models import *"
      _models/ "from .model1 import MyUser"
class MyUser(AbstractBaseUser): 
    <some code>
INSTALLED_APPS = ('project.app1', )
AUTH_USER_MODEL = 'app1.MyUser'

The above gives me:
auth.user: Model has been swapped out for 'app1.MyUser' which has not been installed or is abstract.

If I move the definition of MyUser into app1/ then it works. 

Am I missing something, or is this a bug?

You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment