I downloaded the yelp github for python and there’s three files inside the python folder. I placed these three folders inside a folder named yelp which lays inside mysite. (I’m following django’s creating first app documentation). This mysite folder has the polls folder as well.
When I added yelp into the settings.py INSTALLED_APPS, why do I still get no module named yelp if I tried to do python manage.py runserver?
Please help, I’m still trying to learn how python works, what to do when you bring in a new .py file..?
thank you!
You need to have an
__init__.pyinside both the mysite and yelp directories, and you need to import it asmysite.yelp.Older versions of python will allow implicit relative imports, but in general there should be one root package that’s importable, and anything inside of it should be imported with the full name. And the way django works, your whole site needs to be the importable package.
If there’s an existing project available from github, though, it’s usually a better idea to install the whole thing on your system instead of copying it into your project. That way if there are updates, you can keep up with what’s new and update to the latest.