Django auth. model when using multiple files

Viewed 465

I have just broken up my models.py in to a module as follows:

models/
    __init__.py
    model1.py
    model2.py
    userModel.py
    ....

Where init.py imports all of the classes so I can still get at them using models.model1 as follows

from model1 import model1
from model2 import model2
from userModel import userModel

This is working ok however Django can no longer find the AUTH_USER_MODEL using:

AUTH_USER_MODEL = 'app.userModel'

I get the error:

LookupError: App 'app' doesn't have a 'userModel' model.

I have tried to change this to

AUTH_USER_MODEL = 'app.models.userModel'

but this doesn't work either. Any advice much appreciated

Jack

1 Answers
Related