Skip to content

Demo application on OpenShift | Mobile application deployed on OpenShift built in pure HTML5 with Flask/jQuery Mobile, stores on MongoDB

Notifications You must be signed in to change notification settings

xltian/openshift-myshoppinglist

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

Demo application on OpenShift | Mobile application deployed on OpenShift built in pure HTML5 with Flask/jQuery Mobile, stores on MongoDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published