home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

13 rows where issue = 534492501 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 2

  • simonw 11
  • chekos 2

author_association 2

  • OWNER 11
  • NONE 2

issue 1

  • Mechanism for adding arbitrary pages like /about · 13 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
625321121 https://github.com/simonw/datasette/issues/648#issuecomment-625321121 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDYyNTMyMTEyMQ== chekos 28694175 2020-05-07T15:21:19Z 2020-05-07T15:21:19Z NONE

It seems that heroku wasn't updating to 0.41 on deployment.

Had to add --branch 0.41 and that solved it! Heroku caches dependencies

and (i think) because the requirements.txt doesn't specify the datasette version, it didn't update from 0.40 to 0.41 on heroku even though it was specified on my local requirements file as datasette >= 0.41

These are the lines that gave me an idea on how to solve it: https://github.com/simonw/datasette/blob/182e5c8745c94576718315f7596ccc81e5e2417b/datasette/publish/heroku.py#L164-L186

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
625286519 https://github.com/simonw/datasette/issues/648#issuecomment-625286519 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDYyNTI4NjUxOQ== chekos 28694175 2020-05-07T14:23:22Z 2020-05-07T14:28:33Z NONE

Hi! I'm using datasette on this repository: https://github.com/chekos/RIPA-2018-datasette

and on my local machine i can see an /about page i created but when i deploy to heroku i get a 404 (http://ripa-2018-db.herokuapp.com)

I bumped datasette in my requirements file to 0.41 so I'm 100% what the issue is 🤔

Do you have any idea what could be the problem? 👀

EDIT: for context, I have a templates directory with a pages/about.html file in https://github.com/chekos/RIPA-2018-datasette/tree/master/datasette/templates

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
619612675 https://github.com/simonw/datasette/issues/648#issuecomment-619612675 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDYxOTYxMjY3NQ== simonw 9599 2020-04-26T19:35:09Z 2020-04-26T19:35:09Z OWNER

https://www.niche-museums.com/about now uses this mechanism. It used to be an empty about.db database but you can see from https://www.niche-museums.com/-/databases that it's now using the new mechanism.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
619604720 https://github.com/simonw/datasette/issues/648#issuecomment-619604720 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDYxOTYwNDcyMA== simonw 9599 2020-04-26T18:50:30Z 2020-04-26T18:50:30Z OWNER

Documentation: https://datasette.readthedocs.io/en/latest/custom_templates.html#custom-pages

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
619591380 https://github.com/simonw/datasette/issues/648#issuecomment-619591380 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDYxOTU5MTM4MA== simonw 9599 2020-04-26T17:33:04Z 2020-04-26T17:33:04Z OWNER

Stretch goal: it would be neat if these pages could return custom HTTP headers (eg content-type) and maybe even status codes (eg for redirects) somehow.

I think I could do that with a custom template function - if that function is called during the render then we follow those instructions instead of returning the rendered HTML.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
619263600 https://github.com/simonw/datasette/issues/648#issuecomment-619263600 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDYxOTI2MzYwMA== simonw 9599 2020-04-24T22:23:13Z 2020-04-24T22:23:13Z OWNER

Idea: handle_404 can hand certain not found errors off to handle_500 so it can render them correctly;

https://github.com/simonw/datasette/blob/227bb3e91fe34811a9374150798643a5af98ed79/datasette/app.py#L748-L765

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
619259859 https://github.com/simonw/datasette/issues/648#issuecomment-619259859 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDYxOTI1OTg1OQ== simonw 9599 2020-04-24T22:10:34Z 2020-04-24T22:10:34Z OWNER

The trickiest part here is the 404 logic. It's spread out through a couple of places right now. It's in datasette.utils.asgi.AsgiRouter:

https://github.com/simonw/datasette/blob/227bb3e91fe34811a9374150798643a5af98ed79/datasette/utils/asgi.py#L98-L134

Then also in the `DatasetteRouter subclass of that:

https://github.com/simonw/datasette/blob/227bb3e91fe34811a9374150798643a5af98ed79/datasette/app.py#L736-L757

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
618775631 https://github.com/simonw/datasette/issues/648#issuecomment-618775631 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDYxODc3NTYzMQ== simonw 9599 2020-04-24T03:03:35Z 2020-04-24T03:03:35Z OWNER

Stretch goal: it would be neat if these pages could return custom HTTP headers (eg content-type) and maybe even status codes (eg for redirects) somehow.

I think I could do that with a custom template function - if that function is called during the render then we follow those instructions instead of returning the rendered HTML.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
618775028 https://github.com/simonw/datasette/issues/648#issuecomment-618775028 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDYxODc3NTAyOA== simonw 9599 2020-04-24T03:01:32Z 2020-04-24T03:01:32Z OWNER

Now that I've closed #577 this should be pretty easy to implement.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
563015290 https://github.com/simonw/datasette/issues/648#issuecomment-563015290 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDU2MzAxNTI5MA== simonw 9599 2019-12-09T00:18:17Z 2019-12-09T00:18:17Z OWNER

The implementation in https://github.com/simonw/datasette/commit/c5e8cd84d3ef55ed86771ac0bde0ca91d6b0e07a acts as a proof of concept. It has a big flaw though: it doesn't reuse the regular render() mechanism, which means it doesn't register custom template tags from plugins.

This is bad because it means that pages rendered in this way cannot take advantage of things like datasette-template-sql.

This means this issue is likely dependent on #577 - a documented mechanism to allow plugins to render templates.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
563001064 https://github.com/simonw/datasette/issues/648#issuecomment-563001064 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDU2MzAwMTA2NA== simonw 9599 2019-12-08T22:09:20Z 2019-12-08T22:09:20Z OWNER

Stretch goal: it would be neat if these pages could return custom HTTP headers (eg content-type) and maybe even status codes (eg for redirects) somehow.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
563000942 https://github.com/simonw/datasette/issues/648#issuecomment-563000942 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDU2MzAwMDk0Mg== simonw 9599 2019-12-08T22:08:14Z 2019-12-08T22:08:14Z OWNER

Alternative idea: a new concept of "pages" which live inside templates/pages/ and where the file name minus the .html extension defines the URL.

templates/about/me.html would be served at /about/me - but only if no matching database and table were found.

This only takes effect on 404 errors from core Datasette.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  
562913040 https://github.com/simonw/datasette/issues/648#issuecomment-562913040 https://api.github.com/repos/simonw/datasette/issues/648 MDEyOklzc3VlQ29tbWVudDU2MjkxMzA0MA== simonw 9599 2019-12-08T04:56:43Z 2019-12-08T04:56:43Z OWNER

Idea: do this with a simple template naming convention.

If you hit /about and there is no matching database, check for a template file called about-page.html. If it exists, render it. Otherwise return a 404 database not found.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Mechanism for adding arbitrary pages like /about 534492501  

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
, [performed_via_github_app] TEXT);
CREATE INDEX [idx_issue_comments_issue]
                ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
                ON [issue_comments] ([user]);
Powered by Datasette · Queries took 48.532ms · About: github-to-sqlite
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows