Sunday, October 7, 2012

Quick Guide: Deploying your first Django app to the cloud in about 10 commands

(This guide works with Windows, Mac, and Linux, but you will have to be comfortable with the command line.)

1) https://openshift.redhat.com/app/ << Create a free OpenShift account. When prompted, don't create your first OpenShift app at this time, however.

2) https://openshift.redhat.com/community/get-started << Install all required tools for using OpenShift if you don't already have them. (Skip sections 3-5 on the page that deal with creating/configuring your first app. You'll do that below.) In Ubuntu, for example, you'll need to do the following to install the client tools:

$ sudo apt-get install ruby rubygems git
$ sudo gem install rhc
$ rhc setup

3) https://github.com/openshift/django-example << Follow the instructions on this page. Specifically:

$ rhc app create -a django -t python-2.6
$ cd django
$ git remote add upstream -m master git://github.com/openshift/django-example.git
$ git pull -s recursive -X theirs upstream master
$ git push

4) There is no step four. Following these steps exactly, you've just built and deployed your first Django app in about 10 commands. You can begin customizing the Django example in /django/ and, when you're ready, simply:

$ git commit -am "Comments about your changes"
$ git push

Maybe all this 'cloud' stuff isn't so gimmicky after all. And if Google search trends are anything to go by, learning the Django framework is probably a sensible allocation of your time.

No comments:

Post a Comment