Skip to main content

Mobile Device detection library and wsgi middlewares

Project description

See documentation at http://mobi.infrae.com/

mobi.devices is the set of tools to detect mobile user agents. It uses WURFL database as well as data from MIT mobile project.

It also provides wsgi middlewares that can tag the request with some information about the devices performing the request.

For best performance, please install pytc. It is not a package requirement since it is not available on all platforms.

Paster example configuration:

[app:yourapp]
# This part describe your application
# use = ...

[filter:mobidevicedetection]
# the entry point to use the classifier
use = egg:mobi.devices#classifier
# cache the classification on a client side cookie (default: true)
cookie_cache = true
# configure caching (see beaker documentation
cache.type = ext:memcached
cache.url = 127.0.0.1:11211
cache.lock_dir = /tmp/mobicache
# data directory *required*. make sure directory is writable
# by the user that run the webserver
var = /var/mobi/db
# path to wurfl file. by default it uses the ones shipped with
# this package. however you should use the latest one.
wurfl_file = /var/mobi/wurfl.xml.gz

[filter:mobirouter]
use = egg:mobi.devices#router
# redirect mobile devices that connect to infrae.com hostname
# to m.infrae.com
infrae.com = http://m.infrae.com/

[pipeline:main]
# This part configure the actual WSGI stack
pipeline = mobidevicedetection mobirouter yourapp

[server:main]
# This is the configuration for paster web server.
# It must have the same name as the pipeline
use = egg:Paste#http
host = 0.0.0.0
port = 8080
threadpool_workers = 7

If you are using apache with rewrite rules that modify the path and you want the router to route on the original path, please add the following rule before any rewrite rule

RewriteRule ^(.*)$ - [E=ORIGINAL_PATH:$1]
RequestHeader set X_ORIGINAL_PATH %{ORIGINAL_PATH}e

Changelog

mobi.devices 1.1 (2010-12-20)

  • add original path http header handler to make router work with rewrite rules.

  • add simple router middleware.

mobi.devices 1.0.1 (2010-09-14)

  • fix wurfl file configuration handling

  • fix missing import

mobi.devices 1.0 (2010-09-13)

  • Add new engine for wurfl

mobi.devices 1.0b1 (2010-07-14)

  • first release, see README.txt

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

mobi.devices-1.1.tar.gz (935.7 kB view details)

Uploaded Source

File details

Details for the file mobi.devices-1.1.tar.gz.

File metadata

  • Download URL: mobi.devices-1.1.tar.gz
  • Upload date:
  • Size: 935.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mobi.devices-1.1.tar.gz
Algorithm Hash digest
SHA256 87200e6fa8e11a9317041c260a67834b4db12b1fc1c99c9537b5276da352ae33
MD5 ea9a9a838e82e390b561df73d013de3a
BLAKE2b-256 85179dba3e3f0a6795dc318c60a09832a7fc7251eab1c5549853e53608aaf8b9

See more details on using hashes here.

Provenance

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