All Projects → sholsapp → flask-skeleton

sholsapp / flask-skeleton

Licence: other
A "hello world" style Flask application that uses a few of my favorite plugins.

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects
HTML
75241 projects
Dockerfile
14818 projects
Makefile
30231 projects
Mako
254 projects

Flask Skeleton

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.

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.

Documentation

Quickstart

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/

Packaging

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.

Related Works

  1. sean-/flask-skeleton
  2. graup/flask-restless-security
  3. imwilsonxu/fbone
  4. xen/flask-project-template
  5. jelmerdejong/flask-app-blueprint
  6. sdetautomation/flask-api
  7. cburmeister/flask-bones
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].