Created
August 15, 2011 13:42
-
-
Save gregglind/1146774 to your computer and use it in GitHub Desktop.
A 'Boilerplate' for Flask Application Layouts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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