Pass view_name=page to custom pages, refs #648

This commit is contained in:
Simon Willison 2020-04-26 10:49:57 -07:00
commit b5509a0b0a
3 changed files with 26 additions and 5 deletions

View file

@ -109,6 +109,7 @@ def make_app_client(
inspect_data=None,
static_mounts=None,
template_dir=None,
extra_plugins=None,
):
with tempfile.TemporaryDirectory() as tmpdir:
filepath = os.path.join(tmpdir, filename)
@ -133,6 +134,8 @@ def make_app_client(
os.mkdir(plugins_dir)
open(os.path.join(plugins_dir, "my_plugin.py"), "w").write(PLUGIN1)
open(os.path.join(plugins_dir, "my_plugin_2.py"), "w").write(PLUGIN2)
for filename, content in (extra_plugins or {}).items():
open(os.path.join(plugins_dir, filename), "w").write(content)
config = config or {}
config.update(
{