L

Lokesh Joshi's Take Help From Us

Learndunia.com is e-learning platform for students as well
as for youth who are searching for jobs and how to crack
them easily.

  • Rated3.2/ 5
  • Updated 6 Years Ago

What is the use of __init__.py in django | LearningDunia

Updated 6 Years Ago

Files named __init__.py are used to mark directories on disk as Python package directories. If you have the files mydir/spam/__init__.py mydir/spam/module.py and mydir is on your path, you can import the code in module.py as import spam.module or from spam import module If you remove the __init__.py file, Python will no longer look for submodules inside that directory, so attempts to import the module will fail.
Read More