Content: Blog

Django deployment made as easy as ABC (and PHP)

Daniele Procida

Feb. 17, 2017

PHP was a huge success because it made web publishing easy. We aim to make Django just as easy.

Once upon a time

Many years ago, Divio was a PHP-based web agency, like so many others.

One of the wonderful things about PHP is that it made it remarkably easy for people who weren’t expert system administrators - for example, web designers, content creators, project managers or application developers - to take the final step of publishing their work on the web.

Deployment, in PHP, was truly a breeze. For many of those non-experts, it typically went something like this (using of course the archetypal LAMP stack that has been a cornerstone of the web for a decade and a half):

  • download your PHP application into the appropriate directory on your Linux server
  • wire it up to the MySQL database by editing a config.php file
  • add a new Apache <VirtualHost> directive for the site

… and that was pretty much all they had to do.

It’s easy to forget just how empowering these so-simple deployments were: they made people productive and employable and allowed them to do new things on the web.

Django deployment is a challenge

Now contrast that with the hoops that early Django adopters had to jump through to get their projects on to the web.

For those who had become accustomed to an easy life under PHP, which included of course having PHP installed and supported by default on almost every web host, it was an unwelcome trial.

They had to choose, install and configure a gateway server for Python applications. They had to ensure that their applications were made correctly available for serving. They had to take extra steps to make packages inside a virtualenv available. They had to set up serving for media and static files separately (in fact the official documentation actually recommended installing a separate server for this purpose). And so on…

On Django’s email lists and IRC channels the question came up time and again: Can you recommend a good Django hosting service?

Good, in this context, didn't just mean that it performs well, has helpful technical support and is priced reasonably. It also meant “and will make deploying my Django sites reasonably straightforward”.

Many people have worked very hard since the early days to make Python/Django applications easier to deploy on the web. Support for Python applications is now more readily available on web hosts, and many services are now much better prepared for Python hosting.

… but getting easier

There are more good Django hosting services now than ever before, and many of them are taking extra steps to make setting up and deploying Django projects a better experience, especially for those who are not experienced system administrators.

Django is clearly on the radar of major hosting services now. Services such as DigitalOcean offer one-click Django installations, though they leave wiring up the rest of the deployment to you. Heroku goes a bit deeper, but still leaves you with the responsibility of configuring storage, database, web server and so on.

Python-specialist hosting companies are able to close the gap a lot further. DjangoEurope has been around for several years, offering a one-click setup and a web interface to manage deployment. PythonAnywhere offers a similar service.

Django deployment at Divio

At Divio, where we have deployed literally thousands of Django sites of our own, anything that made the process of deployment faster, easier and more reliable was crucially important to our success.

We built up plenty of expertise doing it the hard way across a multitude of platforms, and developed our Django deployment processes into a fine art practised by skilled system administrators.

Much of that expertise was in automation, so that we could get our systems to deploy sites and servers, consistently, reliably, time after time, and so that the automated processes could be launched by anyone in the team who needed a new deployment - not just by the expert system administrators.

Our deployment tools matured into a comprehensive and thoroughly automated deployment infrastructure, using a reliable and well-tested stack, for Django projects. Our own Divio Cloud platform for Django hosting emerged from them.

Divio Cloud

The Divio Cloud  takes the advances made by other well-known cloud platforms further. A one-click installation isn’t enough, if all the other work required to set up a reliable and secure project is still left to the user.

We think that Python/Django is more secure and a better foundation for web applications than PHP - more elegant, and certainly more reliable, flexible and secure. Programming in Python is a better experience than programming in PHP.

We’re seeing more and more PHP developers and site owners making the move to Python/Django, including several that have engaged us to help them make the transition.

Our mission  is to make it better still, to make working with Python/Django applications on the web as simple as it is for users of PHP - not just for developers, but for designers, content creators and project managers too.

So, the Divio Cloud takes some extra steps that make it genuinely different from the offerings of other services:

Project-centric deployment

Uniquely, the Divio Cloud  gives you complete, ready-to-publish projects, that include configured applications. You don’t need any Python/Django skills to launch a project, complete with applications (django CMS, Wagtail, Oscar Commerce).

Any member of the team, whether a web designer, project managers or content creator, can start and get to work on a new site without needing to wait for someone else to do it for them.   

Project maintenance

Deploying a project is one thing; keeping it up to date, installing new software and managing things like backups are another. Traditionally, these tasks  would have to wait for a system administrator to take care of them; with the Divio Cloud, they can be managed by anyone on the team, through the Control Panel.

Scaling and growth

The Divio Cloud is built to handle sites that will grow. Features such as automated scaling and load balancing don’t need a system administrator’s expert skills to implement: they’re available and ready to from the start. (See the Blick Tippspiel case study for more on how this works in practice.)

Development toolchain

For the Django developer, ensuring that differences between development and deployment environment don’t yield nasty surprises has always been a headache. The Divio Cloud solves this by providing a development toolchain that includes a local development environment, that replicates exactly the Docker-based environment that runs in the cloud. Our promise to our developers is unique: if it runs on your machine, it will run on the web.

Support

Companies like DigitalOcean and Heroku have a lot of expertise. But, their focus is web services in general, and not specifically Python/Django. Our entire mission is built around Django and the needs of Django users. Our platform is built in Django. We’ve been dedicated to Django for almost a decade, and our expertise is the best you’ll find in the world. When you need our support, you’ll find that the friendly person on the other end is a Django expert with the skills and experience to help solve your problem, quickly.

Enjoy an easy life

Everyone wants an easier life, especially people who want to work on websites without needing to be system administrators.

We’ve spent several years making our own lives easier through automation and dedicated Django development tools. Those advantages are available to all users of our Divio Cloud platform - give it a try.