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

Uploaded Python 3

File details

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

File metadata

  • Download URL: flask_humanify-0.1.3.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.tar.gz
Algorithm Hash digest
SHA256 2d886e3fc5927db224f24930998d2077e3b1413b1d35e3c38d051653e3a7b48d
MD5 ef925d0e82e01dd198f2b67b1bee6f6a
BLAKE2b-256 158e15ec5eaa4910f3628c0d9609d2498238af875db96c47a4272753d38b9343

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flask_humanify-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for flask_humanify-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 16449b428f2c03f1f745ffd2abab44ea9894df871815f7a7a712a490dc854e03
MD5 e4babeffd6585c51cb104c3269ca76b1
BLAKE2b-256 3285facc51d17e08d7e9bd3e91ecd10a5e1b5646a165fbcbf78b09b5a092a3eb

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