Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

By rafalpiton
Hello!
I’ve used Django on Ubuntu image to create my droplet and it all worked well until I’ve tried to use virtualenv for django_project dependencies.
I’ve created home/django/venvs dir. Within it I’ve created venv that I have installed my app’s dependencies to.
Then I’ve edited upstart file to following:
description "Gunicorn daemon for Django project"
start on (local-filesystems and net-device-up IFACE=eth0)
stop on runlevel [!12345]
# If the process quits unexpectadly trigger a respawn
respawn
setuid django
setgid django
chdir /home/django
script
source venvs/myapp/bin/activate
end script
exec gunicorn \
--name=django_project \
--pythonpath=django_project \
--bind=0.0.0.0:9000 \
--config /etc/gunicorn.d/gunicorn.py \
django_project.wsgi:application
However Gunicorn fails to start app, which crashes on import of module thats in venv, but not in global python.
Question is what I am doing wrong? How to make default django_project use venv?