This release is a pre-release and may not be stable for production use.
Flask SSL require and redirect decorator
Easy to use package for Flask framework to check if request is served securely.
Please note, that this package does not enable SSL directly in Flask app (however we support that) we recommend you to use reverse proxy or wsgi server with configured SSL params.
Install
pip install flask-ssl
Configuration
You should have working reverse proxy server with configured SSL and SSL header information.
This plugin supports nginx and apache default configurations.
For example, for your nginx installation it will be:
server {
...
location / {
...
proxy_set_header HTTPS on;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Use
from flask_ssl import *
# {...}
@ssl_require
@app.route('/your/url/that/should/be/available/only/with/ssl')
def func():
return "Ok, served via SSL"
@ssl_redirect
@app.route('/your/url/that/should/be/redirected/to/ssl')
def func2():
return "Ok, served via SSL"
License
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright
This software is developed inside Standart AG, LLC, 2019
Release files for flask-ssl 0.0.0.1rc1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flask_ssl-0.0.0.1rc1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / flask_ssl-0.0.0.1rc1-py3-none-any.whl
| Download URL | flask_ssl-0.0.0.1rc1-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
89339a368e9b96023cff9e313c4c38110aa36bd80326361aaeb76d9d8c9e6625
|
|
BLAKE2b-256 checksum How to use checksums |
d1d78e833744bf91bfc235b2c6162bd0ab42c089cdeb732efd9794f06653b6ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
|