Menu
When working on a Django project, I noticed that importing a model from a file within the same directory required using a dot before the name of the file. For instance, to import
from MY_MODEL
, I used models.py
. Could someone explain why the dot is necessary? What happens if the dot is omitted, does it search outside the scope of the current directory? from .models import MY_MODEL