Skip to content

This is the code to go along with the OpenShift blog piece on how to use Flask (python) with MongoDB to create a REST like web service with spatial data

Notifications You must be signed in to change notification settings

thesteve0/openshift-mongo-flask-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openshift-mongo-flask-example

NOTE this will not work in the recent versions of OpenShift Online because the environment variables are not correct in myflaskapp.py. If you want to fix them and give me a pull request it would be much appreciated. K THX BYE

This is the code to go along with the OpenShift blog piece on how to use Flask (python) with MongoDB to create a REST like web service with spatial data

Running on OpenShift

Create an account at http://openshift.redhat.com/

Create a python-2.6 application and add a MongoDB cartridge to the app

rhc app create -a pythonws -t python-2.6
rhc app cartridge add -a pythonws -c mongodb-2.0

Add this upstream flask repo

cd pythonws
git remote add upstream -m master git://github.com/openshift/openshift-mongo-flask-example.git
git pull -s recursive -X theirs upstream master

Then push the repo upstream

git push

To add the data to the MongoDB instance please follow the instructions on this blog: Mongo Spatial on OpenShift

Be sure to:

  • add the data to a collection called parkpoints
  • create the spatial index on the documents

Once the data is imported you can now checkout your application at:

http://pythonws-$yournamespace.rhcloud.com

About

This is the code to go along with the OpenShift blog piece on how to use Flask (python) with MongoDB to create a REST like web service with spatial data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published