Skip to main content

Protect against bots and DDoS attacks

Project description

flask-Humanify

A strong bot protection system for Flask with many features: rate limiting, special rules for users, web crawler detection, and automatic bot detection.

Github PyPI Libraries.io


from flask import Flask
from flask_Humanify import Humanify

app = Flask(__name__)
humanify = Humanify(app)

# Register the middleware to deny access to bots
humanify.register_middleware(action="deny_access")

@app.route("/")
def index():
    """
    A route that is protected against bots and DDoS attacks.
    """
    return "Hello, Human!"

if __name__ == "__main__":
    app.run()

Not using the middleware:

@app.route("/")
def index():
    """
    A route that is protected against bots and DDoS attacks.
    """
    if humanify.is_bot:
        return humanify.deny_access()
    return "Hello, Human!"

Usage

Installation

Install the package with pip:

pip install flask-humanify --upgrade

Import the extension:

from flask_humanify import Humanify

Add the extension to your Flask app:

app = Flask(__name__)
humanify = Humanify(app)

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_humanify-0.1.3.1.tar.gz (5.9 MB view details)

Uploaded Source

Built Distribution

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

flask_humanify-0.1.3.1-py3-none-any.whl (6.1 MB view details)

Uploaded Python 3

File details

Details for the file flask_humanify-0.1.3.1.tar.gz.

File metadata

  • Download URL: flask_humanify-0.1.3.1.tar.gz
  • Upload date:
  • Size: 5.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for flask_humanify-0.1.3.1.tar.gz
Algorithm Hash digest
SHA256 9563f4e45305f91e75828f39686fd8ffecd1fd68853131e6030e89fc6836a96d
MD5 0f94632acbcdc830b44cb734154dc387
BLAKE2b-256 1a53a2fc4f9ecf0f72d0bf06a0a379362f2cfacba3a0f986d843b825d14a1075

See more details on using hashes here.

File details

Details for the file flask_humanify-0.1.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for flask_humanify-0.1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 461e7653a5382cc5b30f2babd5762f225fea61aa2d482b51a810671185d06abc
MD5 6563aec78cdd3a2be158e008997e2a81
BLAKE2b-256 3c86ac002b507a314faa656952c4fbd8d61c8002c4953f8f2ad36d25459fca5d

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