PyBossa/pybossa — pull request #633 by redhog (2014-01-08 17:23:38+00:00)
Title: Support for static files accompanying apps

Every time I develop an app, I have needed to upload images and other auxiliary files somewhere. This has been a manual process, where deploying the app means uploading the files somewhere and changing the urls in the app to match. This has turned out to be a bit error prone...

This change introduces an extension to the API and the presenter to let app developers upload auxiliary files (like css, js, png) together with their app.

Here is an example of an upload for an app called testapp, with id 1:

requests.post("http://localhost:5000/api/app/1/addfile", params={'api_key': 'NANANANOTTELLINGYOU'}, files = {'file': open('test.txt')})

The file can then be accessed through:
/app/testapp/static/test.txt

I plan to add support for this in the pbclient library.