Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browser detection (including browser upgrade notices) for Django
Python
branch: master

This branch is 35 commits ahead, 8 commits behind ionelmc:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
django_badbrowser
.gitignore
CHANGES.txt
LICENSE.txt
MANIFEST.in
README.textile
setup.py

README.textile

django-badbrowser readme

Installation

To install django-badbrowser:

  1. Install with easy_install/pip/whatever
  2. Add django_badbrowser.middleware.BrowserSupportDetection to the MIDDLEWARE_CLASSES setting
  3. Add django_badbrowser to your INSTALLED_APPS setting
  4. Specify the BADBROWSER_REQUIREMENTS setting (see below for details and additional settings)
  5. Include ‘django_badbrowser.urls’

Config options

BADBROWSER_REQUIREMENTS

A list of any specific browser restrictions. Browsers listed here with versions lower than the specified version numbers will be shown the “Unsupported web browser” message. Any browsers not listed here will be free to access the site as normal, as will any clients which do not specify a user agent.

Example:

BADBROWSER_REQUIREMENTS = (
	("firefox", "3.0"),
	("chrome", "3.0"),
	("microsoft internet explorer", "8"),
	("opera", None), # None indicates no support for the given browser, whatever the version
)

BADBROWSER_SUGGEST

A list of browsers to suggest to the user on the “Unsupported web browser” page.

Example:

BADBROWSER_SUGGEST = ("firefox", "chrome", "safari", "opera", "microsoft internet explorer")

BADBROWSER_BASE_TEMPLATE

The base template which should be extended in the rendering of the “Unsupported web browser” page. This page will probably need to have blocks for “extra_head” (within the head tag) and “content” (within the body tag)

Example:

BADBROWSER_BASE_TEMPLATE = "myapp/base.html"
Something went wrong with that request. Please try again.