I don't run into any problems running my django app locally, but for some reason on heroku I get the error ImportError: cannot import name get_path_info and have no idea how to fix this.
Here are my heroku logs:
2014-07-07 18:45:45 [18423] [INFO] Starting gunicorn 0.13.4
2014-07-07 18:45:45 [18424] [ERROR] Exception in worker process:
Traceback (most recent call last):
File "/lib/python2.7/site-packages/gunicorn/arbiter.py", line 456, in spawn_worker
worker.init_process()
File "/lib/python2.7/site-packages/gunicorn/workers/base.py", line 100, in init_process
self.wsgi = self.app.wsgi()
File "/lib/python2.7/site-packages/gunicorn/app/base.py", line 101, in wsgi
self.callable = self.load()
File "/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 24, in load
return util.import_app(self.app_uri)
File "/lib/python2.7/site-packages/gunicorn/util.py", line 241, in import_app
__import__(module)
File "/app/wsgi.py", line 2, in <module>
from dj_static import Cling
File "/lib/python2.7/site-packages/dj_static.py", line 7, in <module>
from django.core.handlers.base import get_path_info
ImportError: cannot import name get_path_info
2014-07-07 18:45:45 [18424] [INFO] Worker exiting (pid: 18424)
18:45:46 web.1 | 2014-07-07 18:45:46 [18423] [INFO] Shutting down: Master
18:45:46 web.1 | 2014-07-07 18:45:46 [18423] [INFO] Reason: Worker failed to boot.
My procfile:
web: gunicorn app.wsgi
and my app/wsgi.py file:
from django.core.wsgi import get_wsgi_application
from dj_static import Cling
application = Cling(get_wsgi_application())
Try setting dj-static==0.0.6 in your Virtualenv requirements.txt file. The Heroku Django tutorial currently shows 0.0.5. You might be running 0.0.6 locally but not in Heroku.
I've reported this issue to Heroku and their tutorial is now updated to reflect newer versions in the requirements.txt.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With