home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 675829942

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions issue performed_via_github_app
https://github.com/simonw/datasette/issues/944#issuecomment-675829942 https://api.github.com/repos/simonw/datasette/issues/944 675829942 MDEyOklzc3VlQ29tbWVudDY3NTgyOTk0Mg== 9599 2020-08-19T03:27:25Z 2020-08-19T03:27:25Z OWNER

I created a template file called templates/pages/museums/{slug}.html and used the debugger to see if Jinja could see it. This worked: (Pdb) self.ds.jinja_env.list_templates() ['500.html', '_codemirror.html', '_codemirror_foot.html', '_description_source_license.html', '_footer.html', '_table.html', 'allow_debug.html', 'base.html', 'database.html', 'default:500.html', 'default:_codemirror.html', 'default:_codemirror_foot.html', 'default:_description_source_license.html', 'default:_footer.html', 'default:_table.html', 'default:allow_debug.html', 'default:base.html', 'default:database.html', 'default:index.html', 'default:logout.html', 'default:messages_debug.html', 'default:patterns.html', 'default:permissions_debug.html', 'default:query.html', 'default:row.html', 'default:show_json.html', 'default:table.html', 'forbidden.html', 'index.html', 'logout.html', 'messages_debug.html', 'pages/about.html', 'pages/museums/{slug}.html', 'patterns.html', 'permissions_debug.html', 'query.html', 'row.html', 'show_json.html', 'table.html'] The pages/museums/{slug}.html template is in that list.

Here's the implementation of that list_templates() method - it does some filesystem walking so it may be a bit expensive to run it on every request: https://github.com/pallets/jinja/blob/ca8b0b0287e320fe1f4a74f36910ef7ae3303d99/src/jinja2/loaders.py#L197-L212

But caching it would be pretty easy - either until the server is restarted or as an in-memory cache for a few seconds.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
681516976  
Powered by Datasette · Queries took 1.328ms · About: github-to-sqlite