Note that there are some explanatory texts on larger screens.

plurals
  1. PODjango ImportError on Heroku
    text
    copied!<p>I tried several things to get my app working on heroku, but now I'm out of ideas. I can install my project on heroku's rep, but I get a 500 error code. My application works very well using virtualenv on my machine after I followed the steps described on heroku documentation for django.</p> <p>When I do my "git push heroku master" and try in browser, I get the following error:</p> <pre><code>2013-07-07T15:39:11.170514+00:00 app[web.1]: ImportError: No module named apps.base 2013-07-07T15:39:11.170059+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/dateformat.py", line 35, in format 2013-07-07T15:39:11.170202+00:00 app[web.1]: app = import_module(appname) 2013-07-07T15:39:11.170202+00:00 app[web.1]: default_translation = _fetch(settings.LANGUAGE_CODE) 2013-07-07T15:39:11.170202+00:00 app[web.1]: _default = translation(settings.LANGUAGE_CODE) </code></pre> <p>I tought it was caused by a directory structure that wasn't supported on heroku, so I adjusted it from the default one that was created with django startproject command.</p> <p>Here is my new file structure. I adjusted the import reference everywhere and as I said, I works pefctly in local:</p> <pre><code>manage.py Procfile requirements.txt vielfaltig |____apps | |____base | | |____models.py | | |____templates | | |____tests.py | | |____urls.py | | |____views.py | |____projects | | |____admin.py | | |____models.py | | |____templates | | |____templatetags | | |____tests.py | | |____translation.py | | |____urls.py | | |____views.py |____locale |____media |____settings.py |____static |____urls.py |____vielfaltig.db |____wsgi.py </code></pre> <p>As you notice, I have 2 apps (base and projects). In the code, I import them using "vielfaltig.apps.base" for example. I changed this everywhere. I had this error before and I changed the directory structure according to what I read when I googled the error. I also tried to put everything in the root directory (along with the requirements.txt and procfile). I don't know why it keeps telling me an ImportError for "apps.base" while I reference the app using "vielfaltif.apps.base" everywhere... ?</p> <p>Does anyone have an idea? I will paste my settings.py if needed. For now I think it would just take a lot of space.</p> <p>Thank you very much for any help !</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload