Skip to main content

High Level Browser Detection Middleware for Turbogears 2, limits access to website only for modern browsers

Project description

About BrowserLimit

Browserlimit is a TurboGears2 extension meant to quickly limit access to a website only to modern browsers. BrowserLimit requires TurboGears2.1.4 or newer.

Installing

tgext.browerlimit can be installed both from pypi or from bitbucket:

easy_install tgext.browserlimit

should just work for most of the users

Enabling BrowserLimit

Using BrowserLimit is quite simple, you can just plug it using tgext.pluggable.

If you want to avoid using tgext.pluggable for any reason it is still possible to use tgext.browserlimit by manually setting it up. At the end of your application config/app_cfg.py import tgext.browserlimit:

import tgext.browserlimit
tgext.browserlimit.plug(base_config, {})

Choosing Browser Limits

By default tgext.browserlimit will limit site access to browsers which have a fairly compatible HTML4 support, those include IE8, Chrome4, Firefox3.6, Safari3.2

This can be changed by specifying the base_config.browserlimit option inside your config/app_cfg.py before loading browserlimit. Valid values are:

  • MODERN -> Most modern browsers with top edge features

  • HTML5 -> Minimal HTML5 support like video and canvas

  • BASIC -> Good HTML4 support (the default)

  • MINIMAL -> Cover as much as possible (minimum IE version 7)

New limits can be enabled using the base_config.browserlimits option. This must be a dictionary where the KEY is the limit name and the value is a class that implements __init__(self, user_agent) and is_meth(self, environ) -> bool methods.

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

tgext.browserlimit-0.1.tar.gz (115.1 kB view details)

Uploaded Source

File details

Details for the file tgext.browserlimit-0.1.tar.gz.

File metadata

File hashes

Hashes for tgext.browserlimit-0.1.tar.gz
Algorithm Hash digest
SHA256 0c53fc9586820790a1bf4dcecf89d7fbcd6a3cd0cd3c7b18181819e332ef678f
MD5 fde59de80fe262b1326e0e05d5b5497c
BLAKE2b-256 d183ed27e46c785b834f7baa44669d11269191bfbb994120bf56ae80208cd6e9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page