1👍
Okay, I’ve found how, in my case, the virtualenv was being invoked for the django.
BASE_DIR/run/gunicorn script has:
#GUNICORN='/usr/bin/gunicorn'
GUNICORN=".venv/bin/gunicorn"
GUNICORN_CONF="$BASE_DIR/run/gconf.py"
.....
$GUNICORN --config $GUNICORN_CONF --daemon --pid $PIDFILE $MODULE
So this takes us into the .venv where the gunicorn script starts with:
#!/media/disk/www/aavso_apps/.venv/bin/python
Voila
0👍
If you use just Django behind a reverse proxy, Django will use whatever is the python environment for the user that started the server was determined in which python
command. If you’re using a management tool like Gunicorn, you can specify which environment to use in those configs. Although Gunicorn itself requires us to activate the virtual environment before invoking Gunicorn
EDIT:
Since you’re using Gunicorn, take a look at this, https://www.digitalocean.com/community/tutorials/how-to-deploy-python-wsgi-apps-using-gunicorn-http-server-behind-nginx
- Multiple forms in one page update concrete block?
- Celery Task class with DRF serializer
- Exclude date via .exclude
- How to access an array index by its value in a Django Template?
- Django TemplateSyntaxError
0👍
Just use absolute path when calling python in virtualenv.
For example your virtualenv is located in /var/webapps/yoursite/env
So you must call it /var/webapps/yoursite/env/bin/python
- Django CMS Placeholder Within Template Block Not Displaying
- Related objects as separate endpoint (the "edge" model) using Django Rest Framework
- Error in viewing extended DetailView in Django
- Detect any changes made to Django models
- Adding documentation to django app – conflict with angular