

Solved my issue after many hours of google searches.

Spent way too much time looking at other poor resources. Archived CommentsĪwesome! Thanks so much. You now have a shiny new uWSGI emperor, serving multiple python apps with support for python 2.7 and 3.4. Include the setting plugin = python27 or plugin = python34 to indicate which python plugin you want to use for that app.Įxample of an app config file in /etc/uwsgi/ (note %n mean "the filename without extension" which makes this sort of settings file really easy to re-use): socket = /apps/%n/uwsgi/socket chmod-socket = 664 master = true processes = 2 virtualenv = /apps/%n/app/venv pythonpath = /apps/%n/app/ module = %n.wsgi pidfile2 = /apps/%n/uwsgi/pid daemonize = /apps/%n/uwsgi/log plugin = python27 Stop on runlevel exec uwsgi -die-on-term -emperor /etc/uwsgi -emperor-tyrant -logto /var/log/uwsgi.logįor each web app you want to run, create a config file in /etc/uwsgi that's owned by the user you want that app to run under.
#UWSGI DIFFERENT PYTHON VERSIONS INSTALL#
Here's an upstart example (same as in my previous tutorial), which you would install as /etc/init/nf: # Emperor uWSGI script Now you could run uWSGI from this folder, but I prefer to install it: mkdir /usr/local/lib/uwsgi/Ĭp python*_plugin.so /usr/local/lib/uwsgi/įinally, you'll want an upstart or systemd file to boot uwsgi. uwsgi -build-plugin "plugins/python python27" uwsgi -build-plugin "plugins/python python34" PYTHON =python2.7. We'll compile uWSGI without Python support, then separately compile plugins for each version of Python we want to support: make PROFILE =nolang Edit buildconf/base.ini and set plugin_dir = /usr/local/lib/uwsgi/. One thing before we compile: we need to tell uWSGI where it's going to find the various python plugins.
#UWSGI DIFFERENT PYTHON VERSIONS UPDATE#
Here's an example check the website for the latest version and update the commands accordingly: wget Just run the following commands as root.įirst download and extract uWSGI. Here is an example of the required steps.

So to get one emperor that can run apps (vassals) with different versions of Python, we need to compile uWSGI. The big downside of that approach is that it only builds uWSGI for the version of Python with which you install it. Normally, I just install uWSGI using pip. I recently wanted to move to a mix of Python 3.4 and Python 2.7 web apps on one of my servers that was set up as described in that tutorial. This is a quick update to my tutorial on hosting Django Apps on Ubuntu with Nginx and uWSGI.
