Giter Club home page Giter Club logo

upload's Introduction

HTML5 upload with photo rotate/crop tools and Django backend

image

A reusable Django app to work with photo and file uploads.

  • contains native JavaScript multifile drag and drop upload UI with instant thumbnails and progress bars, see upload/static/upload.js
  • python/PIL backend for upload, cropping and rotation of photos
  • seamless integration into Django projects
  • image cropping UI (uses jQuery)

Thumbnails are generated using python PIL/Pillow using easy-thumbnails or compatible thumbnailing application such as sorl-thumbnails.

Uploaded files are grouped into collections, the collection model is swappable via settings, so uploaded files can be grouped to a Page, Gallery or RealityListing.

upload.js builds on the following HTML5 demos: http://html5demos.com/dnd-upload http://html5demos.com/file-api upload.js uses the W3C File API https://dev.opera.com/articles/w3c-file-api/

Installation (into a Django project)

To get the latest version from GitHub

pip install -e git+git://github.com/fmalina/upload.git#egg=upload

Add upload to your INSTALLED_APPS

INSTALLED_APPS = (
    ...,
    'upload',
)

Configure your settings to suit, see upload/app_settings.py. You can use the collection model provided or plug your own using settings.py:

UPLOAD['collection_model'] = 'yourcastleapp.Castle'

Add the upload URLs to your urls.py

urlpatterns = [
    ...
    url('', include('upload.urls')),
]

Create your tables

./manage.py migrate upload

Usage

Setup a collection

This app supports multiple collections (or your custom model) with multiple files in each collection.

Add files

Drag and drop upload photos and files into your application. Files can have alternative description and are orderable (TODO, jQuery UI demo).

Remarks

Upload shines best for sites that need user uploaded photo galleries.

It will automatically shard the storage folder so as to not hit ext3 subfolder limit (~32000 folders).

Included is also a backup management tool to sync/download publicly uploaded files from server to a local machine.

Planned features

Current storage layout presumes collections to be related to users, which will be addressed in the next update.

Contribute

Fork it and send your pull request. File and issue. Mention on your blog, tweet, status update. Tell your dev friends and mention when complaining to sites that have poor upload features.

Flask reusability rewrite would be a welcome contribution, if you need another server backend such as for MongoDB or PHP please fork off and let me know how you get on.

upload's People

Contributors

fmalina avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.