Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Internet > HTTP (WWW)

    django-browser-info 1.0.1

    Download button

    No screenshots available
    Downloads: 208  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Chris Drackett | More programs
    BSD License / FREE
    May 6th, 2012, 21:20 GMT
    ROOT / Internet / HTTP (WWW)

     Read user reviews (0)  Refer to a friend  Subscribe

    django-browser-info description

    Django middleware and view decorator to add browser info to the request object

    django-browser-info is a Django app that adds attributes to your request object that describe the users browser. This will let you fine tune the templates or code to use based on the traits of the browser.

    The following is currently added to the request:

    Simple Device:

            request.is_simple_device

    True for all non-desktop devices (browsers) without "modern" CSS and JS support. This includes non "smart" phones and simpler browsers like those found on game consoles and the kindle.

    Touch Device:

            request.is_touch_device

    True for devices that use touch events.

    Wide Device:

            request.is_wide_device

    True for devices that are wider than a common mobile phone. This covers tablets and desktop browsers.

    Device Type:

            request.is_ios_device
            request.is_android_device
            request.is_webos_device
            request.is_windows_phone_device
            request.is_kindle_device


    True if the device is part of the given platform.

    These give more granular information about modern smart devices. This is helpful if you want to target features to a specific device type.

    Other Attributes:

            request.is_webkit

    True if the browser is webkit (desktop or mobile.)

    Installation:

    After you've added browser_info to your python path (manually or with pip) you can access its attributes with one of two methods.

    All Requests:

    To use browser_info on all requests just add

            browser_info.Middleware

    to the `MIDDLEWARE_CLASSES` tuple in your settings.py

    Specific Requests:

    If you only have certain views that need the distinction all you need to do is wrap the relevant views like this:

            from browser_info import add_browser_info

            @add_browser_info
            def my_mobile_view(request):
                    # your view code here.



    Product's homepage

    Requirements:

    · Python
    · Django

      


    TAGS:

    view decorator | request object | Django middleware | Django | view | decorator

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM