Skip to main content

Flask decorator to mark pages as deprecated with visual warnings

Project description

deprecated-decorator-flask

A Flask decorator to mark pages as deprecated with visual warnings and HTTP headers.

Installation

pip install deprecated-decorator-flask

Usage

from flask import Flask
from deprecated_decorator_flask import deprecated

app = Flask(__name__)

# Basic usage
@app.route('/old-page')
@deprecated
def old_page():
    return "<html><body><h1>Old Page</h1></body></html>"

# With custom message
@app.route('/old-page2')
@deprecated(message="Use /new-page instead.")
def old_page2():
    return "<html><body><h1>Old Page 2</h1></body></html>"

# With sunset date
@app.route('/old-page3')
@deprecated(message="Use /new-page instead.", sunset="2025-09-01")
def old_page3():
    return "<html><body><h1>Old Page 3</h1></body></html>"

Features

  • Visual Warning: Adds a blinking red border around the page and a sticky warning banner
  • HTTP Headers: Adds Deprecation, X-Deprecated-Message, and Sunset headers
  • Metadata: Decorated functions get _deprecated, _deprecated_message, and _deprecated_sunset attributes

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

deprecated_decorator_flask-0.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deprecated_decorator_flask-0.1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file deprecated_decorator_flask-0.1.0.tar.gz.

File metadata

File hashes

Hashes for deprecated_decorator_flask-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c90a26c54f46d9cec5aac2991656d722dcbdb9b89ee9db90d28f20f825ba525c
MD5 e602040549eac819cfd0c4d400197895
BLAKE2b-256 b8ee92538b1c39eacfc66d1b5492527d8321e38084beb9f8c42a513102b13abc

See more details on using hashes here.

File details

Details for the file deprecated_decorator_flask-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for deprecated_decorator_flask-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca6eb33f708bf5dff4cea863427ccf4c07228f02c840082c6a4a93f701211b41
MD5 d0a81795fb82c97db772abfb93d43a0a
BLAKE2b-256 4e9f402abd3045c1399a21f3aedd2afd02281b23862952dee75bc417daade25d

See more details on using hashes here.

Supported by

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