Skip to main content

Flask-Staticify

A simple extension that makes it possible to define the additional static locations your Flask application will traverse as a fallback. Miss Django’s STATICFILES_DIRS setting? This mimics that functionallty.

Only works when app.debug is set to True.

Usage

Let’s have an example from the scratch:

>>> from flask.ext.staticify import mount_folders
>>> app.debug = True

# Ah, snap!
>>> app.test_client().get('/static/app.js')
<Response [404]>

>>> STATICIFY_FOLDERS = (
...    os.path.join(app.root_path, 'tmp'),
...    ('prefix', 'path/to/folder')
>>> )
# Mounting will override the endpoint='static' view function
# to look also into the additional folders as a fallback.
>>> mount_folders(app, STATICIFY_FOLDERS)

# And that's it!
>>> app.test_client().get('/static/app.js')
<Response [200]>

API

mount_folders(app, locations)

A single top-level function where the all magic comes from.

locations

an iterable of strings with the additional static locations. It also accepts a 2-tuple of the form (prefix, folder) and using a prefix is a way to connect specific urls with a folder directly.

Install

$ pip install Flask-Staticify

Metadata

Release files for Flask-Staticify 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Flask-Staticify 0.2.2
File Size Uploaded Provenance Actions
Flask-Staticify-0.2.2.tar.gz 2.4 kB Without provenance Details for Flask-Staticify-0.2.2.tar.gz

Release files / Flask-Staticify-0.2.2.tar.gz

Download URL Flask-Staticify-0.2.2.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
875232c3ff32155f34ad14935a92ebe1c2926325399682f70374af267591a019
BLAKE2b-256 checksum
How to use checksums
70176a03dc1450cdcab714fbcb32ec4fe325b706f3040cbe08f5e67743414224
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for Flask-Staticify 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page