Gunicorn+Django+Heroku. Python Path Issue -


i'm running django app used deploy heroku gunicorn without hitch. mean run

foreman start 

on localhost , able understand whether application work in production environment. made decision move of our project's applications subfolder named 'applications'. meant editing django_settings_module environment variable among other files. after doing this, experimented foreman , gunicorn until got local server , running. @ point deployed production. needless say, there error:

running `gunicorn --workers=4 applications.rocketlistings.wsgi -b 0.0.0.0: -k gevent` attached terminal... up, run.8052 traceback (most recent call last):   file "/app/.heroku/python/bin/gunicorn", line 9, in <module>     load_entry_point('gunicorn==0.17.2', 'console_scripts', 'gunicorn')()   file "/app/.heroku/python/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/pkg_resources.py", line 343, in load_entry_point     return get_distribution(dist).load_entry_point(group, name)   file "/app/.heroku/python/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/pkg_resources.py", line 2307, in load_entry_point     return ep.load()   file "/app/.heroku/python/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/pkg_resources.py", line 2013, in load     entry = __import__(self.module_name, globals(),globals(), ['__name__']) importerror: no module named app.wsgiapp 

i'm not sure i'm doing wrong, , it's difficult debug situation given obscure remote setup heroku runs. other threads discussing error suggest path problem. sounds plausible, can't think of wrong path, given have init.py file in applications folder, , works locally.

here production path/pythonpath anyway:

running `echo $path` attached terminal... up, run.2583 /app/.heroku/python/bin:/usr/local/bin:/usr/bin:/bin  running `echo $pythonpath` attached terminal... up, run.8026 /app/ 

thanks in advance!

sometimes, occurs when gunicorn finds module called 'app' in pythonpath. setting pythonpath fake value resolves issue:

$ heroku config:set pythonpath=fakepath 

https://github.com/heroku/heroku-buildpack-python/wiki/troubleshooting#no-module-named-appwsgiapp


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -