Skip to content

Conversation

@agafonovdmitry
Copy link

When DEBUG=False importing FormDefinition causes circular importing of User model.
Here is a "fix".

When DEBUG=False importing FormDefinition causes circular importing of User model.
Here is a "fix".
@ldgarcia
Copy link

@samluescher, this commit is the correct way to do it.

According to the docs:

Generally speaking, you should reference the User model with the AUTH_USER_MODEL setting in code that is executed at import time. get_user_model() only works once Django has imported all models.

See: https://docs.djangoproject.com/en/1.7/topics/auth/customizing/

I am getting the following error when running migrate, because of the get_user_model():

django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants