Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 841
Mickey Cheong Avatar asked Jan 11 '12 16:01

Mickey Cheong


1 Answers

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
like image 172
Mickey Cheong Avatar answered Oct 23 '22 08:10

Mickey Cheong