TurboGears / tg2

Python web framework with full-stack layer implemented on top of a microframework core with support for SQL DBMS, MongoDB and Pluggable Applications
http://www.turbogears.org/
Other
803 stars 77 forks source link

Add storage manager to tg #92

Closed eteamin closed 7 years ago

eteamin commented 7 years ago

I assume Turbogears lacks a storage manager for storing files on disk which an API similar to something below

from tg import storage filename = storage.store(file)

and files are stored in public folder by default in a folder named storage. I am willing to add this feature if it's ok with you.

amol- commented 7 years ago

The most frequently used storage system when working with TurboGears2 is filedepot https://depot.readthedocs.io/en/latest/ which provides a TurboGears example https://github.com/amol-/depot/tree/master/examples/turbogears with guidance on how to setup filedepot in TurboGears itself.

The proposed implementation is also something that the user can probably achieve just be writing files into tg.config['paths']['static_files'] and I don't feel it should be part of TG itself, maybe you want to propose it as a pull request for https://github.com/TurboGears/tgext.utils ? That would be a better suiting place for such feature.