Welcome to Django Download_stats’s app documentation!

Introduction

django-download_stats is an reusable application for Django framework , that allows users to download files and also create a download record.

Installation

Install django-download_stats by running:

startapp.sh django-download_stats

Running the tests

python setup.py test

Requirements:

django >= 1.4

Contents:

Getting Started Guide

Installation

pip install https://bitbucket.org/unh-gislab/download_stats_1.0/get/v1.0.zip

Source code can be downloaded from https://bitbucket.org/unh-gislab/download_stats_1.0

Run startapp.sh download_stats to start the app

Configuration

  • Add to the INSTALLED_APPS in settings.py:

    download_stats

Edit config.py and setup.py for more advanced configuration

How django-download_stats works

def download_file(request,filename=''):
    from .helpers import FileRegistry
    file_registry = FileRegistry()
    f = file_registry.get_file(request)
    if f.is_valid():
        return f.send_file()
    else:
        raise Http404

Testing

Running the test

python setup.py test

Contributing Guide

Code struture

  • download_stats/helpers.py
  • download_stats/models.py
  • download_stats/tests.py
  • download_stats/urls.py
  • download_stats/views.py