Skip to main content

Template support for flask application

Project description

Template support for flask application, a collection for useful extra filters and functions, and an easy way to register them.

Quickstart

Install flask_template_support using pip:

$ pip install Flask-TemplateSupport

Example usage

from flask import render_template
from flask_template_support import TemplateSupport


def test_sum(a, b):
    return a + b


def test_sub(a, b):
    return a - b


app = Flask(__name__)
ts = TemplateSupport()

ts.init_app(app, functs=(
        (test_sum, 'sum'),
        (test_sub, 'sub'),
    ))

Run test.py in example folder and go to http://127.0.0.1:5000/ to see how it works

Configuration

  1. NOT_AVAILABLE_DESC: (default: N/A) description for or_na filter

  2. PRETTY_DATE: (default: %d %B %Y %I:%M:%S %p) default date format for pretty_date filter

  3. HUMAN_FILE_SIZE_DIVIDER: (default: 1000) default divider for human_file_size filter

  4. HUMAN_FILE_SIZE_SCALE: (default: [‘KB’, ‘MB’, ‘GB’, ‘TB’]) default scale for human_file_size filter

License MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Flask-TemplateSupport-2.0.0.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file Flask-TemplateSupport-2.0.0.tar.gz.

File metadata

  • Download URL: Flask-TemplateSupport-2.0.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for Flask-TemplateSupport-2.0.0.tar.gz
Algorithm Hash digest
SHA256 76b63d7cce12abb5b8b8a1cbc7e325207bfe27aadece4561be9ae5abb5d1b6f2
MD5 c201d70ed72a639ab33a3a5e5d6596f0
BLAKE2b-256 62339dc8f6bbd7c769d5d46650ee76a6a773243e374ad4913384ea51baa00fa2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page