Skip to content

Store user uploaded files in a clipboard like environment for easy submitting AJAX forms with Files.

License

Notifications You must be signed in to change notification settings

IndustriaTech/django-user-clipboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django User Clipboard

This app returns to user JSONs from uploaded file/image.

This app is connected with django user model.

This app needs django-imagekit

SetUp

Install the app:

pip install git+https://github.com/IndustriaTech/django-user-clipboard.git

You should have these in installed apps:

INSTALLED_APPS = (
    ....

    'imagekit',
    'user_clipboard',
)

Add the urls in your main urls.py file:

url(r'^clipboard/', include('user_clipboard.urls')),

You can configure defaut values with theese settings:

CLIPBOARD_IMAGE_WIDTH = 100
CLIPBOARD_IMAGE_HEIGHT = 100
CLIPBOARD_THUMBNAIL_QUALITY = 80

And finally you can run the migrations:

python manage.py migrate

In order to clear old objects from the storage you need to periodically clear the storage. You can achieve that by executing:

python manage.py clear_clipboard

By default all files older than one hour are deleted. You can configure the time by setting:

CLIPBOARD_EXPIRATION_TIME = 60 * 60

Programatically you can delete these in your python code by calling:

Clipboard.objects.expired().delete()

You need to configre cron or celery or something else to clear the storage periodically.

About

Store user uploaded files in a clipboard like environment for easy submitting AJAX forms with Files.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published