Coder Social home page Coder Social logo

headnet / mobi.devices Goto Github PK

View Code? Open in Web Editor NEW

This project forked from infrae/mobi.devices

1.0 7.0 0.0 6.07 MB

python library and wsgi middleware for mobile device detection

Home Page: mobi.infrae.com

License: BSD 4-Clause "Original" or "Old" License

Python 100.00%

mobi.devices's Introduction

mobi.devices

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

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

It provides WSGI middleware that can tag a request with information about the device 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 describes 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 one 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 configures the actual WSGI stack
pipeline = mobidevicedetection mobirouter yourapp

[server:main]
# This is the configuration for the 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

mobi.devices's People

Contributors

gwik avatar bbinet avatar malthe avatar kitblake avatar

Watchers

Pelle Krøgholt avatar Lasse avatar Troels Larsen avatar James Cloos avatar Martin Andrej Johan Grönlund avatar Nikolaj avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.