Porte-document pour la GRC
Go to file
Christophe Siraut d1d4c60269 debian: bump debhelper compatibility level (#32260) 2019-04-16 14:34:16 +02:00
debian debian: bump debhelper compatibility level (#32260) 2019-04-16 14:34:16 +02:00
fargo settings: force 0644 as mode for uploaded files (#30905) 2019-02-26 14:50:21 +01:00
tests views: set Location properly after upload (fixes #30218) 2019-01-30 12:16:23 +01:00
.gitignore update .gitignore to mention fargo instead of authentic directories 2015-04-12 21:16:41 +02:00
COPYING Revert "Add a send-to view (fixes #7080)" 2015-05-18 10:48:59 +02:00
Jenkinsfile build: add jenkinsfile 2019-03-31 16:25:58 +02:00
MANIFEST.in misc: sync setup stuff with newer templates 2015-08-18 17:27:46 +02:00
README misc: sync setup stuff with newer templates 2015-08-18 17:27:46 +02:00
jenkins.sh jenkins.sh; add flag -r to tox 2017-03-22 23:52:33 +01:00
manage.py Initialize fargo 2015-02-13 14:58:25 +01:00
merge-coverage.py jenkins.sh: add missing helper scripts 2016-03-29 15:10:38 +02:00
merge-junit-results.py jenkins.sh: add missing helper scripts 2016-03-29 15:10:38 +02:00
pylint.sh build: add jenkinsfile 2019-03-31 16:25:58 +02:00
requirements.txt misc: allow django-jsonfield 1 (#11192) 2017-04-24 12:47:58 +02:00
setup.py misc: generate a version number that's compatible with PEP 440 (#25597) 2018-08-12 16:46:55 +02:00
tox.ini build: add jenkinsfile 2019-03-31 16:25:58 +02:00

README

Fargo
=====

To start do:

    pip install -e .
    ./manage.py migrate
    ./manage.py runserver

To use your own settings make the LOCAL_SETTINGS environment variable point to
a settings file that will be executed in the context of the project settings
module, at its end.

Settings
========

 Nothing for now.

Requesting a file from another application
==========================================

Downloading a file from fargo is easy:
- Open http://fargo/?pick=http://yoursite/pick-a-file/ in a popup or iframe
- When the user choose a file it is returned to

     http://yoursite/pick-a-file/?url=http://fargo/remote-download/name-of-the-file?token=xxxxxx

   Your view on this URL should download the file from the given URL, do
   something with it then close the popup/iframe.

Download URL are only valid during 60 seconds after the request will return
status 403. If the file has been removed a 404 is returned.

Displaying the list of files of a user
======================================

There are two methods JSONP and JSON, both are totally insecure, protect
them with your web server and IP limitations for now.

JSONP
-----

 * Add this to your page

    <script>function callback(data) {
        // display the file list by modifying the DOM
    }</script>
    <script src="http://fargo/jsonp/?callback=callback"></script>

 * data is structured like this:

    [ { 'url': 'http://fargo/download/etc..', 'filename': 'facture.pdf'}, ... ]

JSON
----

 * Do a get on http://fargo/json/?username=john.doe

Showing an upload form
======================

You can open an upload form to fargo by creating a popup or an iframe with
location http://fargo/upload/. You can pass a parameter ?next=http://yoursite/
if you want the user to come back  to your site after the upload, to close the
popup or the destroy the iframe.