6

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.

Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264
Mickey Cheong
  • 2,980
  • 6
  • 38
  • 50

1 Answers1

4

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
Mickey Cheong
  • 2,980
  • 6
  • 38
  • 50
  • dude you saved lot of my time. Thanks for this. If you can post the same answer here - http://stackoverflow.com/questions/12455883/django-gunicorn-wsgi I will be happy to give you the bounty. – Srikar Appalaraju Sep 21 '12 at 13:18