About Bot Detection
You can detect if a request is made by a crawler using the crawlerdetect package:
def is_bot_or_crawler(request):
from crawlerdetect import CrawlerDetect
user_agent = request.META.get("HTTP_USER_AGENT", "")
crawler_detect = CrawlerDetect()
return crawler_detect.isCrawler(user_agent)
Tips and Tricks Programming Django 5.2 Django 4.2 Python 3 crawlerdetect
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django App for You
Django GDPR Cookie Consent app
For Django websites that use cookies.
Django App for You