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.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

Flask_TemplateSupport-2.0.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: Flask-TemplateSupport-2.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 d9eb7f3f0a6db73b2a0b0c459789f8f031f89596c539051035a329193d2550d0
MD5 a0362f4e355d2e7bdb4818aaee7639ff
BLAKE2b-256 dfdce1c79953e5b10523e68c8248d6c7cd5ca32493be33d08b6c228517b20b4f

See more details on using hashes here.

File details

Details for the file Flask_TemplateSupport-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: Flask_TemplateSupport-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b8f5d333aae96fa0d76796fd76b652039a205aa8457586a845ed16427d355bb
MD5 8db1c486e766517728f3015789813954
BLAKE2b-256 5232ca56771a9cc99451c733edb5ae38fed15aaebf656da9df8696548875b963

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