GithubHelp home page GithubHelp logo

jupyter-notebook-service's Introduction

Flask App Example + Template

hello-flask is an example app viewable at:

and can be used as a template for other Flask apps.

Overview

This app includes

  • The usage of tox to run:
    • An automated code formatter black
    • Tests with test coverage pytest
  • A pipeline to deploy your app via Kanopy, with:
    • An example for setting environment variables and secrets
    • An example for metrics collecting/sending
    • An example for logging to Splunk
  • Use of gunicorn for staging and production environments

Adding to the template

  • Add filenames and search terms to be updated in make_project.py (In other words, if you add a file to the template repo that contains "hello-flask" in it, you would add it to the list of files to searched and replaced.)

Usage

Using the template

The make_project.py script:

  1. Creates a new directory with your app name in the specified parent directory.
  2. Updates occurrences of hello-flask with your project's name in all files, and updates occurrences of python versions.

Execute the script by running make_project.py with command line arguments --app-name, --parent-directory, --python-version: Examples:

  • ./make_project.py --app-name [YOUR_APP_NAME]
  • ./make_project.py --app-name [YOUR_APP_NAME] --parent-directory [PARENT_DIRECTORY]
  • ./make_project.py --app-name [YOUR_APP_NAME] --python-version [PYTHON_VERSION]

Example: ./make_project.py --app-name my-new-project --parent-directory ../ --python-version 3.7.6

Notes:

  • Usage of --python-version should be considered with available Docker Official Images
  • gevent (a current dependency of the hello-flask app) is currently compatible with python versions <= 3.7

Deploying your app

Testing your app

  • Run tox

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.