Templates
Flask S3Viewer provides CLI to help customize templates.
Get template source
You can customize the template with CLI tool.
See help.
# You can see the details
flask_s3_viewer -h
=================== Flask S3Viewer Command Line Tool ====================
optional arguments:
-h, --help show this help message and exit
-p PATH, --path PATH Enter the directory path where the template will be
located
-t {base,mdl}, --template {base,mdl}
Enter the name of the template to import. (mdl means
material-design-lite and base means not designed
template).
Get the template to your repository.
# Get a Material-design-lite template
flask_s3_viewer --path templates/mdl --template mdl
# Get a base template (not designed at all)
flask_s3_viewer -p templates/base -t base
When you run the command, you can see the
{repository}/{path}/{template}
has been created on your
repository. then rerun the Flask application.
And you can also change template directory if you want.
For examples, Get Material-design-lite template to templates/customized
directory on your root path.
flask_s3_viewer -p templates/customized -t mdl
Then change template_namespace. it will be routed to defined directory (templates/customized
).
s3viewer = FlaskS3Viewer(
...
template_namespace='customized',
...
)
Warning
The template folder of Flask S3Viewer is fixed as templates
. so if you change template_namespace
, It will be routed {repository}/templates/{defined template_namespace_by_you}.