Welcome to TurboGears 2.3, standing on the shoulders of giants, since 2007

Welcome to DEPOT Example

This is plain example that permits to upload images throught the TurboGears Admin

${h.icon('book')} Upload Images!

Steps to setup DEPOT on TurboGears

  1. Setup a Storage where files can be saved

    Inside config/app_cfg.py use DepotManager to configure a storage to save files, the following example configures a local files storage named default that saves files on /tmp

    from depot.manager import DepotManager
    DepotManager.configure('default', {'depot.storage_path': '/tmp/'})
                        

  2. Register a DEPOT middleware to serve files

    Inside config/middleware.py use DepotManager to wrap your turbogears application with the depot middleware which will serve the saved files on /depot url.

    from depot.manager import DepotManager
    app = DepotManager.make_middleware(app)
                        

  3. Start uploading your files!

    Files you upload using DepotManager.get().create(file) can be retrieved back on /depot/default/FILEID url where fileid is returned by the create() method.

Thank you for choosing DEPOT