This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

django-basic-stats is a simple traffic statistics application. It show latest referrer, google queried terms or overall hits count.

It also provides optional logging and statistics for mobile devices (user agent, screen and window width/height, device pixel ratio).

Installation

  • Run pip install django-basic-stats
  • Add ‘stats’, to INSTALLED_APPS
  • Add ‘stats.statsMiddleware.statsMiddleware’ to MIDDLEWARE_CLASSES
  • Add url(r’^stats/’, include(‘stats.urls’)) to your urlpatterns in urls.py
  • Run “syncdb” or “migrate” if you are using South

Enabling mobile device logging

Mobile devices are logged via JavaScript code sending AJAX requests if browser USER AGENT matches one of mobile devices.

Assuming you have jQuery available you will have to add such JavaScript code to you site:

var ismobile = (/iphone|ipod|android|blackberry|mini|palm|smartphone|ipad|xoom|playbook|tablet|mobile|kindle/i.test(navigator.userAgent.toLowerCase()));
if (ismobile) {
    $(document).ready(function(){
        $.ajax({
        url: '/stats/mobile/',
        cache: false,
        type: "GET",
        data: {"window_width": window.innerWidth,
        "window_height": window.innerHeight,
        "screen_width": screen.width,
        "screen_height": screen.height,
        "device_pixel_ratio": window.devicePixelRatio},
        });
    });
}

If you are using other JavaScript library you will have to redo the AJAX sending part. Note that /stats/mobile/ is a hardcoded URL.

Usage

Statistics are visible for site staff. Login to you site as such user and go to /stats/

In Django admin panel you will also get “Mobile” model with all logged mobile devices.

Release History

Release History

0.1.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-basic-stats-0.1.1.tar.gz (8.5 kB) Copy SHA256 Checksum SHA256 Source Jul 31, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting