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

This simple app provides:

  • a Document model with:
    • a generic many to many relation
    • a file field that uploads to a private directory
    • a method get_download_url()
  • a view to download a document which allows custom security checks through a signal
  • a signal, document_pre_download, that is emited by the download view, and which responds with 503 if emiting the signal raises a DownloadForbidden exception
  • clean admin integration
  • south support

Install django-generic-m2m

Refer to django-generic-m2m installation documentation, do “Installation” and “Adding to your Django Project”.

Install autocomplete_light

Refer to django-autocomplete-light installation documentation, do “Quick install” and “Quick admin integration”.

Install django-documents

Download the lastest release:

pip install django-documents

Or install the development version:

pip install -e git+https://github.com/yourlabs/django-documents.git#egg=documents

Add to settings.INSTALLED_APPS:

'documents',

If using south, run:

./manage.py migrate

Else, run:

./manage.py syncdb

Add to urls.py:

url(r'^documents/', include('documents.urls')),

Set settings.DOCUMENTS_UPLOAD_TO to the absolute path where uploads should be stored. This must be a private directory.

Prepare the generic many to many autocomplete

Register a generic autocomplete, with name “AutocompleteDocumentRelations”. There is an example in test_project which is imported in urls.py. Refer the django-autocomplete-light documentation about the registry for alternative methods.

If the project already uses django-generic-m2m and django-autocomplete-light, a good solution is to re-register the project’s generic autocomplete with name=’AutocompleteDocumentRelations’, ie.:

# your project specific autocomplete
class AutocompleteProject(autocomplete_light.AutocompleteGenericBase):
    # ....

# register for your project needs
autocomplete_light.register(AutocompleteProject)

# registery for documents relations
autocomplete_light.register(AutocompleteProject,
    name='AutocompleteDocumentRelations')

Secure your documents

Connect to document_pre_import, for example:

# project specific document permissions
import documents
def document_security(sender, request, document, **kwargs):
    if not request.user.is_staff:
        raise documents.DownloadForbidden()
documents.document_pre_download.connect(document_security)
Release History

Release History

0.0.3

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.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.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-documents-0.0.3.tar.gz (10.2 kB) Copy SHA256 Checksum SHA256 Source Jul 12, 2012

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