django ImportError: No module named yoursitename 8
This has been frustrating me on and off for quite a while. Here’s how to fix it.
add a file called __init__.py to your folder. Done.
The error message, if you can call it that, is vague.
Basically, all python modules require this file.
Django doesn’t add one when you create a site ( an oversight in my opinion ), so you have to remember to add one. I have been doing PYTHONPATH funkiness and other hacks to get the site working without this. Now I can just relax, code and drink tea.
Trackbacks
Use the following link to trackback from your own site:
http://www.nervetree.com/trackbacks?article_id=django-importerror-no-module-named-yoursitename&day=16&month=12&year=2007
Thanks. That was a time saver!
Thank you! I took me some time to find an error. Your hint was very valuable!
That just saved me from committing sepuku.
Thanks for this mate. Life saver!
You are brilliant, this was really driving me nuts. I spent hrs on it.
Thank you.
still doesn’t work. I’ve installed the project into directory named different from project name. might that be a problem?
I’m trying to make a site that sells larimar earrings. I have a group page that lists larimar earrings, the path to the item pages is such /larimar-earrings/earring-1.html. I’m trying to import a URL file in the app folder, and I have a init.py file. It doesn’t seem to work though.
good for you.