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, andSunsetheaders - Metadata: Decorated functions get
_deprecated,_deprecated_message, and_deprecated_sunsetattributes
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deprecated_decorator_flask-0.1.0.tar.gz.
File metadata
- Download URL: deprecated_decorator_flask-0.1.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c90a26c54f46d9cec5aac2991656d722dcbdb9b89ee9db90d28f20f825ba525c
|
|
| MD5 |
e602040549eac819cfd0c4d400197895
|
|
| BLAKE2b-256 |
b8ee92538b1c39eacfc66d1b5492527d8321e38084beb9f8c42a513102b13abc
|
File details
Details for the file deprecated_decorator_flask-0.1.0-py3-none-any.whl.
File metadata
- Download URL: deprecated_decorator_flask-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca6eb33f708bf5dff4cea863427ccf4c07228f02c840082c6a4a93f701211b41
|
|
| MD5 |
d0a81795fb82c97db772abfb93d43a0a
|
|
| BLAKE2b-256 |
4e9f402abd3045c1399a21f3aedd2afd02281b23862952dee75bc417daade25d
|