Closed gnbl closed 3 years ago
In debug-mode, templates are not cached. Live-testing a template is as easy as writing minimal application that serves it, editing the template and hit reload. Writing a small script that does what you want would also quite straight forward. I do not think this use-case is common enough to justify adding complexity of the bottle.py CLI.
Good morning! I've tried the IRC with no response, so forgive me for asking the following question in the issue tracker:
I'd like to live-test specific templates with the development server. I suppose I could use a catch-all route to select the template directly, but as I also am experimenting with generating static pages, I'd like to specify the template from the command line.
Is there a way to "bind" a template to a request without decorator function?
These both work, but I'm wondering how it might be possible to avoid the wrapper function:
I suppose the callback (https://bottlepy.org/docs/dev/api.html#bottle.Bottle.route) would have to get its arguments somehow (https://bottlepy.org/docs/dev/api.html#bottle.template).
On a somewhat related note: the CLI needs a python file with route definitions (https://bottlepy.org/docs/dev/tutorial.html#command-line-interface). It might be a nice feature to serve or render a specified template, e.g.