django ImportError: No module named yoursitename 11

Posted by Joel Jensen Sun, 16 Dec 2007 18:47:43 GMT

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

Comments

Leave a comment

  1. Fabian 8 months later:

    Thanks. That was a time saver!

  2. Matthias 10 months later:

    Thank you! I took me some time to find an error. Your hint was very valuable!

  3. conficker about 1 year later:

    That just saved me from committing sepuku.

  4. Dane Glerum about 1 year later:

    Thanks for this mate. Life saver!

  5. ruwaiting.com/paultyrrell about 1 year later:

    You are brilliant, this was really driving me nuts. I spent hrs on it.

    Thank you.

  6. gaius-julius.livejournal.com about 1 year later:

    still doesn’t work. I’ve installed the project into directory named different from project name. might that be a problem?

  7. perforated metal over 3 years later:

    Thank you in support of getting the time to talk about this, I think strongly

    about that and love learning a lot more on this subject. If achievable,

    when you acquire expertise, would you mind updating your blog with

    additional facts? It is extremely very helpful.

  8. portable generators over 3 years later:

    These kind of post are always inspiring and I prefer to read quality content so I’m happy to find many good point here in the post, writing is simply great, thank you for the post.

  9. portable generators over 3 years later:

    These kind of post are always inspiring and I prefer to read quality content so I’m happy to find many good point here in the post, writing is simply great, thank you for the post.

  10. Stainless Steel Valves over 3 years later:

    I am not sure where you are getting your information, but good topic. I needs to spend some time learning much more or understanding more. portable generators

  11. YemSalat over 4 years later:

    Thanks a bunch!

    This was much more helpful then stackoverflow’s millions of pointless answers.

Comments