background preloader

Django

Facebook Twitter

Django deployment using OpenShift. Posted by: Nate Aune 1 year, 5 months ago Comments OpenShift is a platform-as-a-service (PaaS) that lets you quickly and easily deploy Django/Python apps to a production hosting environment.

Django deployment using OpenShift

The OpenShift software is open source so you can either run it on servers that you own or rent, or you can use Redhat's hosted OpenShift service at This is the third article in a series about deploying Django web applications using a PaaS. I'll walk you through the steps to deploy Mezzanine, a popular Django-based blogging and content management system (CMS).

The first thing you need to do is install the OpenShift client (rhc). Next we'll run the setup which creates a config file and SSH keypair: I found that at least on MacOSX, I had to add the SSH key and start the SSH agent: To make sure that you have everything set up properly, you can run some tests which should all pass: Quick 'n dirty instructions The repository that contains the code used in this example can be found in the openshift branch: Django on OpenShift. Writing your first Django app, part 1. Let’s learn by example.

Writing your first Django app, part 1

Throughout this tutorial, we’ll walk you through the creation of a basic poll application. It’ll consist of two parts: A public site that lets people view polls and vote in them.An admin site that lets you add, change, and delete polls. We’ll assume you have Django installed already. You can tell Django is installed and which version by running the following command: $ python -c "import django; print(django.get_version())" If Django is installed, you should see the version of your installation. This tutorial is written for Django 1.9 and Python 3.4 or later. See How to install Django for advice on how to remove older versions of Django and install a newer one. Where to get help: If you’re having trouble going through this tutorial, please post a message to django-users or drop by #django on irc.freenode.net to chat with other Django users who might be able to help.

Creating a project¶ $ django-admin startproject mysite Note Where should this code live? Rapid Python and Django App Deployment to the Cloud with a PaaS. Red Hat's OpenShift is a Platform-as-a-Service that hosts Django applications in the cloud.

Rapid Python and Django App Deployment to the Cloud with a PaaS

A Platform-as-a-Service allows developers to focus on code instead of configuring and maintaining servers. Combining Django with a PaaS makes developing and deploying web applications fast and elegant. In this blog post I am going to show you how easy it is to get started with deploying new and existing Django applications to OpenShift.