how do you import the modules in python?

You can convert the directory into a package with a __init__.py file. Then as usual you can import the module from the package as in:

from entity.models import func

The __init__.py file can just be an empty file. Just its existence will treat the directory as a package.

Hope this answer helps.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top