File upload functionality
Project description
Add basic file upload functionality to your Pyramid app.
Use
Prepare environment.
export VIRTUAL_ENV=~/.virtualenvs/crosscompute virtualenv ${VIRTUAL_ENV} source ${VIRTUAL_ENV}/bin/activate export NODE_PATH=${VIRTUAL_ENV}/lib/node_modules npm install -g browserify uglify-js
Install package.
cd ~/Projects/invisibleroads-uploads python setup.py develop bash refresh.sh
Add settings.
upload.id.length = 32
Configure views.
config.include('invisibleroads_uploads')
Call template macro.
{% from 'invisibleroads_uploads:templates/parts.jinja2' import upload_button %} {{ upload_button(request, id='xyz-upload', text='Browse for xyz', class='xyz') }}
Add callback and activate button.
$('#xyz-upload').on('uploaded.ir', function(e, d) { console.log(d.upload_id); }).enable();
0.2
Ignore multiple clicks on upload button until dialog closes
Replace uploaded.ir.upload with uploaded.ir
0.1
Add basic upload functionality
Ignore multiple clicks on upload button for a few seconds
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for invisibleroads-uploads-0.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88f8ad08348095ab8677c7a9b00cd388ddcf6c78890d1d75354b761d7ca1ba41 |
|
MD5 | 031c610b6da82b45e2aeddef20060ee6 |
|
BLAKE2b-256 | 70f195680aca0c37a5ecbf81a3876b31d348aedb7878228d930ab888f27e6c78 |