diff options
author | Thomas Waldmann <tw AT waldmann-edv DOT de> | 2014-03-24 14:43:25 +0100 |
---|---|---|
committer | Thomas Waldmann <tw AT waldmann-edv DOT de> | 2014-03-24 14:43:25 +0100 |
commit | 93c8aa11eb6764faa7f65ffb5896e4f36b7cc737 (patch) | |
tree | bc20fc0d514a4ecd4edf041f187face12abd1c58 | |
parent | 71de4fa7c526e5b7e2dd42157ff35315c8dc5c64 (diff) | |
download | xstatic-93c8aa11eb6764faa7f65ffb5896e4f36b7cc737.tar.gz |
usage docs: simplify/fix static file serving map setup code
-rw-r--r-- | docs/source/using.rst | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/docs/source/using.rst b/docs/source/using.rst index d464734..e7e400c 100644 --- a/docs/source/using.rst +++ b/docs/source/using.rst @@ -31,10 +31,11 @@ Example code to setup local file serving 'jquery', 'bootstrap', 'font_awesome', ] pkg = __import__('xstatic.pkg', fromlist=mod_names) + serve_files = {} for mod_name in mod_names: mod = getattr(pkg, mod_name) xs = XStatic(mod, root_url='/static', provider='local', protocol='http') - serve_files.update([(xs.name, xs.base_dir)]) + serve_files[xs.name] = xs.base_dir # now, serve_files has the mapping name -> base_dir for all the xstatic # packages you want to use. you can use it in your python code to set |