# add this to your robots.txt: # User-agent: * # Disallow: /trap # # Make sure this URL is not linked from anywhere else. # Then when a user visits there you know they are ignoring your robots.txt. # Add this snippet to your controller to block their IP. BAN_IP_TIME = 60*60*24 if cache.ram(request.client, lambda: False, BAN_IP_TIME): raise HTTP(503, 'IP blocked') def trap(): cache.ram(request.client, None) cache.ram(request.client, lambda: True, BAN_IP_TIME) redirect(URL(f='index'))
Comments (0)