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.2.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.2-py3-none-any.whl (6.1 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: flask_humanify-0.1.3.2.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.2.tar.gz
Algorithm Hash digest
SHA256 33f3be352b17d327992649f9ef2414cdaa03ede02392e37dbacd1d6641c52266
MD5 61eacf522a441daf16db4d9258bb43e8
BLAKE2b-256 5fb9c0ac138541de3d19ef75e7eb559c0181a4582fb422d604f2a28b98ed945e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flask_humanify-0.1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4819751957509f75c4a06dac247487e52982f665847ad8618bfc7677b58e30af
MD5 a1df0d8014a1f36df13c34df5ef7766a
BLAKE2b-256 d93cf1c20c31e42f5029dacb48056fb43c3c7de692f547ed6a48cc169053d5da

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