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 Compress Storage
=======================

|Build Status| |Latest Version| |BSD License| |Pypi Download|

Custom ZipFileField for Django that auto compact file uploaded

Install
-------

.. code:: bash

pip install django-compress-storage

or by source code

.. code:: bash

git clone https://github.com/valdergallo/django-compress-storage/
python setup.py install

Features
--------

- Compress FileUpload storage file with Zip
- Delete old file that was compressed on zip
- Support for South Migrations
- Support Django 1.2+
- Celery 2.5+ support - async compress file with Celery
- Windows Support
- Linux support
- OSx support
- Support for Python3
- Support for Python2.6+

Motivation
----------

On my job we need save all upload files for 5 year. Losing a lot space
on server with this files, because this I created this application.

Django Settings Configurations
------------------------------

.. code:: python


FILE_COMPRESS_DELETE_OLD_FILE = True # to delete old files after compressed
FILE_COMPRESS_DELETE_OLD_FILE = False # to not delete old files after compressed

# Feature only for version v9.0+
FILE_COMPRESS_QUEUE = 'Celery' # by default queue is Celery, but you can change this with this var on settings


INSTALLED_APPS = (
...
...
'compress_storage',
)

Usage
-----

.. code:: python


# example model.py

from django.db import models
from compress_storage import ZipFileField

class MyContent(models.Model):
name = models.CharField(max_length=150)
create_date = models.DateTimeField(auto_now=True)
upload_file = ZipFileField(upload_to='mycontent/')

def __unicode__(self):
return self.name

Shell
-----

.. code:: python


>>> from example.core import MyContent
>>> m = MyContent.objects.get(id=2)
>>> m.upload_file
<zipcompressfieldfile: mycontent="" test.txt="">
>>> m.upload_file.compress()
>>> m.upload_file
<zipcompressfieldfile: mycontent="" test.zip="">

Using with Celery
-----------------

If Celery are installed on Site Packages. You just need create one
post\_save on your model to use async compress.

.. code:: python

# listeners.py file

from django.db.models.signals import post_save

def auto_compress_file_on_post_save(sender, instance, **kargs):
instance.upload_file.compress()

post_save.connect(auto_compress_file_on_post_save, sender=MyContent)

If you don´t wanna use Celery async compress:

.. code:: python


def auto_compress_file_on_post_save(sender, instance, **kargs):
instance.upload_file.compress(async=False)

post_save.connect(auto_compress_file_on_post_save, sender=MyContent)


.
Release History

Release History

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

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

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

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

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

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-compress-storage-0.9.1.tar.gz (4.6 kB) Copy SHA256 Checksum SHA256 Source Feb 4, 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