0
Completed
Using virtualenv with Ajenti V and gunicorn
I'm looking for advice on using the Python WSGI in Ajenti V.
Gunicorn is able to find my module (a Django app) but I cannot seem to get it to recognize my python path, e.g. /srv/website/env, so it fails trying to import django.core.wsgi. The only way I can get the app to start is if I install my python packages like Django globally. Is there a way to use virtual environments with the current Python WSGI plugin?
Gunicorn is able to find my module (a Django app) but I cannot seem to get it to recognize my python path, e.g. /srv/website/env, so it fails trying to import django.core.wsgi. The only way I can get the app to start is if I install my python packages like Django globally. Is there a way to use virtual environments with the current Python WSGI plugin?
Customer support service by UserEcho
In the past I've run python projects through uWSGI where I would specify the top-level virtualenv (eg /srv/website/env) via the home parameter in the configuration.
It's been simple enough to add a sys.path.append to my application with the path to the packages folder. My failing was trying to ram through '/srv/website/env' when I needed the directory where the packages actually living, e.g./srv/website/env/lib/python2.7/site-packages.
Is this thread still active? I'M going through lots of problems working with django and ajenti.
Hi Dennis - probably a good idea to submit a new topic if you're running into a specific issue.
The changes described in this thread were made a long time ago and did fix things for me. I do find it sometimes tricky to get things up and running at first, but it's usually related to something other than Ajenti.
I can tell you a bit about my own setup in light of the original post:
See: http://support.ajenti.org/topics/1125-setting-up-a-python-website-with-ajenti-v-django-example/ for some tips here (don't follow the Django setup steps as they look outdated to me, but do consult Setting up Ajenti V onwards).
Logs for Gunicorn will be under the supervisor folder (/var/log/supervisor I think), which is usually the first thing I check if things aren't working. As a sanity check you should also see if Django's runserver command launches or points out errors in your Django app.
Thanks Jordan..your procedure worked like a charm. But i had to use virtualenv without a virtualenvwrapper.im not sure if ajenti supports virtualenvwrapper...does it?