TAGS :Viewed: 7 - Published at: a few seconds ago

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

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.

Answer 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