Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Demo application on OpenShift | Mobile application deployed on OpenShift built in pure HTML5 with Flask/jQuery Mobile, stores on MongoDB
branch: master

This branch is 12 commits behind openshift-quickstart:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.openshift
data
libs
wsgi
.gitignore
README
README.textile
setup.py

README.textile

My Shopping List

This is a demo app for mobiles written using Flask and jQuery Mobile. The backend storage is MongoDB.

The app allows you to check and edit some shopping lists from your mobile phone! So if your fellow file it from home, you’ll have it at your fingers later, when at the mall!

It has been deployed on OpenShift which offers MongoDB instances for free, as well as support for any Python WSGI app. Flask is installed using virtualenv.

Deployment

Create the application on OpenShift:

$ rhc app create -a myshoppinglist -t python-2.6

add the mongodb cartridge:

$ rhc app cartridge add -a myshoppinglist -c mongodb-2.0

add the remote github repo to the existing one with a command like:

$ cd myshoppinglist
$ git remote add upstream git://github.com/openshift/openshift-myshoppinglist.git

and then pull in your local repo the changes:

$ git pull -X theirs upstream master
$ git push

that’s it! the database connectivity is guaranteed by the following environment variables, defined on the OpenShift servers:

dbhost = os.environ['OPENSHIFT_NOSQL_DB_HOST']
dbport = int(os.environ['OPENSHIFT_NOSQL_DB_PORT'])
dbuser = os.environ['OPENSHIFT_NOSQL_DB_USERNAME']
dbpass = os.environ['OPENSHIFT_NOSQL_DB_PASSWORD']

if you choose to give the app a different name, don’t forget to reflect the changes in the ‘application’ file where, by default, the database opened is called ‘myshoppinglist’.

Enjoy!

Something went wrong with that request. Please try again.