Skip to content

Instantly share code, notes, and snippets.

@gregglind
Created August 15, 2011 13:42
Show Gist options
  • Save gregglind/1146774 to your computer and use it in GitHub Desktop.
Save gregglind/1146774 to your computer and use it in GitHub Desktop.
A 'Boilerplate' for Flask Application Layouts
#!/bin/bash
# tested on osx, mostly
# tested on ubuntu
#
# to use: /bin/bash -xc "$( curl -fsSL 'https://raw.github.com/gist/1146774' )"
#
#
set -o errexit
set -o nounset
DEFAULTAPP=myapp
MYAPP=${1:-$DEFAULTAPP}
mkdir -p "$MYAPP"/{adhoc,apis,docs,tests,utils,views}
touch "$MYAPP"/{__init__.py,settings.py,models.py}
touch manage.py
curl -fsSL 'http://github.com/paulirish/html5-boilerplate/zipball/v2.0' -o v2.0
unzip -q v2.0
mv paulirish* "$MYAPP"/static
rm v2.0
# requirments, very opinionated
cat > requirements.txt << EOF
Flask
#Flask-MongoEngine==0.1.2
https://github.com/sbook/flask-mongoengine/tarball/master
Flask-Mail
Flask-SQLAlchemy
Flask-Script
Flask-WTF
pymongo
mongoengine
decorator
distribute
simpleapi
EOF
echo "boilerplate complete."
cat << EOF
#######################
# to get more out of this:
# assuming you have virtualenv and mkvirtualenv
# http://www.doughellmann.com/projects/virtualenvwrapper/
mkvirtualenv --no-site-packages $MYAPP
workon $MYAPP
pip install -r requirements.txt
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment