A "hello world" style Flask web server application that applies good practices learned over the years. This application is meant to be copied and pasted, refactored, and specialized to suit your needs.
- APScheduler
- Authlib
- Flask-Bootstrap
- Flask-Restless
- Flask-SQLAlchemy
- Flask-Script
- Flask-Security
- Flask
- Gunicorn
Out of the box, it comes with a simple OAuth2 integration against Google
Calendar API. If you want to use this integration, you'll need to follow the
directions here to setup an
application on your Google API Console. Export the client/secret to
GOOGLE_CLIENT_ID
/GOOGLE_CLIENT_SECRET
, respectively. If you don't want this
integration, deleting this code should be straight forward.
Use Docker to build and run the webapp locally.
docker build -t sholsapp/flask-skeleton:0.1 .
docker run --publish 5000:5000 --detach sholsapp/flask-skeleton:0.1
# You'll need to log in to the container and initialize the database using
# alembic unless you're using a remote database.
# $ alembic upgrade head
curl http://0.0.0.0:5000/
Use Docker to build a deployable .deb package, and create a container to copy the .deb to the local host's current directory.
docker build -f Dockerfile --target builder -t sholsapp/flask-skeleton-builder .
docker create --cidfile .tmp-docker-container-id sholsapp/flask-skeleton-builder
xargs -I {} docker cp -a "{}:/build/flask-skeleton_0.1-1_amd64.deb" . < .tmp-docker-container-id
xargs -I {} docker rm -f "{}" < .tmp-docker-container-id
rm .tmp-docker-container-id
Then .deb has the application code, dependencies, and configuration wrapped up.
Installing it will put the application in /opt/flask-skeleton and install an
init.d script so you can start the application with service flask-skeleton start
.
Deploy the .deb as you see fit.