A Python Flask Web App Development Skeleton using mongoDB featuring javascript.
I wanted to learn some neat tools so I created this project to tie a few interesting things together. After you start up the virtual machine, you will be able to query the database which dynamically generates a templated javascript map to view GPS coordinates and information based on zipcodes.
Bring up the virtualmachine and provision the server
$ vagrant up
Point your browser at
http://localhost:5000/
Cleaning up
$ vagrant destroy
If you accidently delete the dir before doing destroy
$ VBoxManage list vms
$ VBoxManage unregistervm flask-app-server –delete
####Requires:
- Vagrant --
sudo apt-get install vagrant
1.2.2 - VirtualBox --
sudo apt-get install virtualbox-4.2
####Built On:
- ansible -- provisioner loaded up first
- Flask -- Python microframework web app engine
- mongoDB -- noSQL database
- Flask-PyMongo -- bridges Flask and PyMongo
- [leafletjs] (http://leafletjs.com/) -- javascript mapping
- [bootstrap] (http://twitter.github.io/bootstrap/) -- pretty css
####TODO:
- Try out some Javascript Charts & Graphs:
- Various Mapping Styles:
- Play with adding an Nginx layer on top of Flask
####Issues:
- sometimes have to vagrant ssh && sudo supervisorctl start flask-mongo-app
####Notes:
- bootstrap.sh does a one-time install of ansible to get the ball rolling
- mongodb stores its data files in /var/lib/mongodb/
- mongodb stores its log files in /var/log/mongodb/
####My workflow:
- git config --global user.name 'Your Name'
- git config --global user.email your@email
- git pull
- edit some code
- git add
- git commit -am 'fixed some bugs'
- git push -u origin master
####Thanks to:
- http://www.pixelmonkey.org/2013/03/13/rapid-web-prototyping-with-lightweight-tools
- http://ryaneshea.com/lightweight-python-apps-with-flask-twitter-bootstrap-and-heroku
- Fork it.
- Create a branch (
git checkout -b my_new_feature
) - Commit your changes (
git commit -am "Added Cool Thing"
) - Push to the branch (
git push origin my_new_feature
) - Open a Pull Request
- Enjoy a few plumphelmets while you wait cuz I've never done this before.