run_gunicorn works but not gunicorn_django despite both within the same environment, can't see registration module

南楼画角 提交于 2019-12-10 04:22:55

问题


I have an issue here where I did "gunicorn_django" but it says "ImportError: No module named registration"

However, when I do python manage.py run_gunicorn, it runs perfectly.

One way I did to verify that gunicorn_django and registration are both in the same environment is that, when I deactivate it, I run gunicorn_django, it returns command not found and when I did python and try to import registration, it is not found as well.

However, when i did use the virtualenv "workon projectname", both "gunicorn_django" and "import registration" works.

Anything i can do? Please help.


回答1:


It's the new django 1.4 project structure.

So I workaround it by doing this in my supervisor.conf

command=/sites/.virtualenvs/<project>/bin/python /sites/<domain>/code/<project>/manage.py run_gunicorn -c /sites/<domain>/code/<project>/configs/prod/gunicorn.conf.py


来源:https://stackoverflow.com/questions/8823164/run-gunicorn-works-but-not-gunicorn-django-despite-both-within-the-same-environm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!