[Answered ]-Error with Python import

1👍

dont do

from badgify.models.base.badge import Badge as BaseBadge

instead do

import badgify.models.base.badge

class GuidaBadge(badgify.models.base.badge.Badge):
    class Meta(BaseBadge.Meta):
        abstract = False

“from” and “as” imports are having problems with circularity because of namespace changes (the from imported module is not recognized as the original model because it is imported as a different namespace).

1👍

main.models.py:

Is your file named that way or is it models.py that lives in main directory? If first one, change it to second one.

Check also that you have __init__.py file in main directory and that your main directory lives in python path.

Leave a comment