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 Uploader
***************


What it does
============

Django Uploader uses `jQuery file upload`_ to allow drag-and-drop file upload of any file type in the Django Admin. Third-party applications to write handlers for specific file types, and register them with Django Uploader. When a file of that type is uploaded, it passes the information to the handler so that it can make a new record with that file.

.. _jQuery file upload: https://blueimp.github.io/jQuery-File-Upload/



Installation
============

1. Installation is easy using ``pip``::

pip install django-uploader

2. Add ``uploader`` to your ``INSTALLED_APPS`` setting.
3. Add the uploader's urls::

url(r'^upload/', include('uploader.urls')),

4. Write one or more upload handlers.
5. Go to /admin/uploader/upload/ to start uploading.


Writing an upload handler
=========================

.. note:: An upload handler does not have to exist within the application for which it creates records. It must simply be within an application that is imported so the handler can be discovered.

An upload handler assigns one or more MIME types to a function. There should only be one handler for a given MIME type, although Uploader does allow some overlap using '\*'. For example, you can have one handler that handles ``image/tiff`` and another that handles ``image/*`` and yet another that handles ``*/*``\ . The ``image/tiff`` handler would get any ``.tiff`` images, the ``image/*`` would get any other type of image and the ``*/*`` handler would get any other type of file.

To start, create a file named ``upload.py`` in your application. This file can contain several different handlers. When the Uploader application is first loaded, it attempts to import this file from every installed application.

A basic handler looks like this::

from uploader.registration import upload_handlers

def photo_handler(obj):
"""
Handle the creation of a SimpleModel record from an uploaded image.
"""
from .models import SimpleModel

new_item = SimpleModel.objects.create(
name=obj.filename,
slug=obj.filename_slug,
description='',
file=obj.file_contents
)

return new_item
photo_handler.thumbnail_attribute = 'thumb'

upload_handlers.register(['image/jpeg', 'image/png'], photo_handler)
Release History

Release History

0.2.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.2

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.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

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-uploader-0.2.1.tar.gz (794.5 kB) Copy SHA256 Checksum SHA256 Source May 22, 2015

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