Index ¦ Archives ¦ Atom

Modern Django with Ubuntu Trusty

At this point Ubuntu 14.04 Trusty Tahr is nearly 2.5 years old, with another 2.5 years support left until it reaches end of life for support. However for those of us still working with Trusty, it's often desirable to try and get a few backported modern packages to make development and hosting of Django apps a bit easier to work with.

These days you could use containers to deploy bleeding edge applications with all the new stuff bundled inside, maybe with either Docker or rkt. However in this post we'll be going through a couple of available APT repositories to help modernise a slightly older distribution.


As of October 2016, Python 3.5 is the latest stable version of Python. It's supported in Django 1.8 to 1.10, and for anyone wanting to develop an app for the long term - going for Python 2.7 at this point in time is a dead end. Ubuntu Trusty only has Python 2.7 and 3.4, although 3.4 is well supported - we want to try and go for the latest possible Python version.


The Old and New Python Versions repository (or deadsnakes) provides multiple Python versions which aren't included in a particular version of Ubuntu. Consider the support of this repository carefully, as it isn't an official repo (stick with Python 3.4 if this bothers you).

Installation is quick and easy:

$ sudo add-apt-repository ppa:fkrull/deadsnakes
$ sudo apt-get update
$ sudo apt-get install python3.5

As deadsnakes provides even more versions - we could also install Python 3.3 as well, which could help in testing code under multiple Python versions with tox.


Ubuntu Trusty comes with PostgreSQL 9.3, which is missing JSONB support. So if we want the JSONField which is new since Django 1.9 - we'll need a more modern version of Postgres. As of October 2016 the latest release of Postgres is 9.6 - which is what we want to aim for.

PostgreSQL Apt Repository

Fortunately provides official packages of all the supported Postgres versions for quite a few supported distributions. As this is provided by the official Postgres site, packages are updated with every new release - so support is good.

To install:

$ sudo add-apt-repository "deb trusty-pgdg main"
$ curl -sL | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install postgresql-9.6

Now we can use JSONField thanks to the updated Postgres.


Just because you're stuck on an older release of Ubuntu doesn't mean you're stuck with all the old tools - go upgrade!

© Alex Tomkins.