Skip to content
Switch branches/tags
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Source code for my blog, avaliable at and hosted on openshift cloud

It is build with python 2.7, django, mysql.

Runtime Configuration (thanks to openshift-diy-py27-django example, most install sequence i've got from there)

Create a new OpenShift app:

  • rhc-create-app -a <app_name> -t diy-0.1

Add mysql, phpmyadmin, cron cartridges:

  • rhc-ctl-app -a <app_name> -e add-mysql-5.1
  • rhc-ctl-app -a <app_name> -e add-phpmyadmin-3.4
  • rhc-ctl-app -a <app_name> -e add-cron-1.4

Login to the application host using the credentials from the above command. It will look like ssh://c8812345:123214@<app_name>

  • ssh c8812345:123214@<app_name>

Change into the application tmp directory:


Download Python2.7 and extract:

  • wget
  • tar jxf Python-2.7.3.tar.bz2

Build and install Python

  • cd Python-2.7.3
  • ./configure --prefix=$OPENSHIFT_REPO_DIR/../
  • make ; make install

Export new Python path for later configuration (you will need to run this if you logout, etc.):

  • export PATH=$OPENSHIFT_REPO_DIR/../bin:$PATH

Check that new Python is used (should be Python 2.7.3):

  • python -V

Install setuptools and pip

  • wget
  • tar zxf setuptools-0.6c11.tar.gz
  • cd setuptools-0.6c11
  • python install
  • wget
  • tar zxf pip-1.1.tar.gz
  • cd pip-1.1
  • python install

Install uWSGI

  • pip install uwsgi

Install MySQL-python

  • pip install MySQL-python


  • cd ~
  • rm -rf $OPENSHIFT_TMP_DIR/*

Application Setup

Clone / Fork this repo.

Add an upstream to OpenShift:

  • Get the Git URL from rhc app show -a <app_name>
  • git remote add openshift <GIT_URL_from_above>
  • git push openshift master

Note: you may get an error during the git push to openshift saying the repo is not in sync. If you don't have any changes in the OpenShift repo, you can force the push with:

git push -f openshift master

Set custom variables:

# linkedin
rhc set-env LINKEDIN_STORE_CACHE="False" -a <app_name>
rhc set-env LINKEDIN_CONSUMER_KEY="TBD" -a <app_name>
rhc set-env LINKEDIN_CONSUMER_SECRET="TBD" -a <app_name>
rhc set-env LINKEDIN_USER_TOKEN='TBD' -a <app_name>
rhc set-env LINKEDIN_USER_SECRET='TBD' -a <app_name>
rhc set-env LINKEDIN_RETURN_URL='TBD' -a <app_name>

# email
rhc set-env EMAIL_HOST='TBD' -a <app_name>
rhc set-env EMAIL_HOST_USER='TBD' -a <app_name>
rhc set-env EMAIL_HOST_PASSWORD='TBD' -a <app_name>
rhc set-env EMAIL_PORT='TBD' -a <app_name>
rhc set-env EMAIL_USE_TLS='True' -a <app_name>

# to list all custom variables
rhc list-env

# to unset custom variables
rhc unset-env

# help
rhc help env

Get linked-in keys here:

Useful commands

  • rhc ssh -a <app_name>

* Note

If you change the Django application name (in the repo it's named myblog) you will also need to update the .app_name file with the new name in order for the OpenShift start/stop scripts to work.


repository of my blog



No releases published


No packages published