Skip to content
Snippets Groups Projects
Commit 17016266f03f authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

use filesystem storage for files (closes #2996454)

parent 85c0a4436baa
No related branches found
No related tags found
No related merge requests found
hooks.py 0 → 100644
from os import makedirs
from os.path import join, exists
from cubicweb.server import hook
from cubicweb.server.sources import storages
class ServerStartupHook(hook.Hook):
__regid__ = 'drh.serverstartup'
events = ('server_startup', 'server_maintenance')
def __call__(self):
bfssdir = join(self.repo.config.appdatahome, 'bfss')
if not exists(bfssdir):
makedirs(bfssdir)
print 'created', bfssdir
storage = storages.BytesFileSystemStorage(bfssdir)
storages.set_attribute_storage(self.repo, 'File', 'data', storage)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment