Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ImportError: cannot import name FormDefinition #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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