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.4
Define Upload.save, Upload.save_from, Upload.load
Replace get_upload_from with Upload.get_from
0.3
Handle HTTP status code 413 Payload Too Large
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
Built Distribution
File details
Details for the file invisibleroads-uploads-0.4.2.4.tar.gz
.
File metadata
- Download URL: invisibleroads-uploads-0.4.2.4.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0133d0f10b1c23fefb60ee3fc90a514bb4334a6239ff153bcf7a3a8c9ab6ff7a |
|
MD5 | c4047b54c034204ff92c5d4a1b2319f0 |
|
BLAKE2b-256 | cbc58a0628188f2faa0ef3d473ac6c473bba90150517bd3c4448edec01baa68e |
File details
Details for the file invisibleroads_uploads-0.4.2.4-py3-none-any.whl
.
File metadata
- Download URL: invisibleroads_uploads-0.4.2.4-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cab56ebf9285523c8e07ade812bc0fddb47efe854d7b7edf395554ebd2b8e894 |
|
MD5 | 5458c9071e74ff77eb2cedf0b94cc6a4 |
|
BLAKE2b-256 | 09fbabc6ecba4962e4235b68745cbbf546c5b0e5063089d3e298fed76610e726 |