Commit graph

794 commits

Author SHA1 Message Date
Simon Willison
b794554a26 Replaced sanic.response and finished removing Sanic entirely in favour of ASGI 2019-06-23 20:03:33 -07:00
Simon Willison
eba15fb5a8 Renamed Request.from_path_with_query_string() to Request.fake() 2019-06-23 16:49:57 -07:00
Simon Willison
5e12239402 Replaced sanic.request.Request 2019-06-23 16:42:49 -07:00
Simon Willison
d0fc117693 Removed rogue debug print 2019-06-23 16:32:06 -07:00
Simon Willison
176dd4f12a DatasetteRouter is no longer a nested class 2019-06-23 16:02:33 -07:00
Simon Willison
3c4d4f3535 Replaced sanic.exceptions.NotFound 2019-06-23 15:28:14 -07:00
Simon Willison
979ae4f916 Replaced sanic.request.RequestParameters 2019-06-23 15:23:53 -07:00
Simon Willison
1e0998ed2d Removed Sanic HTTPMethodView 2019-06-23 15:13:25 -07:00
Simon Willison
79950c9643 Implemented HEAD requests, removed Sanic InvalidUsage 2019-06-23 15:06:43 -07:00
Simon Willison
620f0aa4f8 Cleaned up favicon() 2019-06-23 14:55:19 -07:00
Simon Willison
28c31b228d Implemented ASGI lifespan #272
Also did a little bit of lint cleanup
2019-06-23 13:31:03 -07:00
Simon Willison
b1c6db4b8f Re-implemented tracing, refs #272 2019-06-23 12:55:16 -07:00
Simon Willison
1e8419bde4 Use correct content-type header, refs #272 2019-06-23 12:52:35 -07:00
Simon Willison
1208bcbfe8 Handle tables%2fwith%2fslashes 2019-06-23 09:06:11 -07:00
Simon Willison
4b6b409d85 Test harness simulates raw_path/path properly
This causes tests to fail.
2019-06-23 08:59:10 -07:00
Simon Willison
d60fbfcae2 Merge branch 'master' into asgi 2019-06-23 08:30:22 -07:00
Simon Willison
cbd0c014ec Hoping this will allow github to resolve the merge conflict with master 2019-06-23 08:29:02 -07:00
Simon Willison
3bd5e14bc1 Fix for Python 3.5 2019-06-23 08:09:41 -07:00
Simon Willison
b97cd53a48 Fix for Python 3.5 - refs #272 2019-06-23 08:03:42 -07:00
Simon Willison
5bd510b01a Re-implemented redirect on 404 with trailing slash, refs #272
All of the tests now pass
2019-06-23 07:55:55 -07:00
Simon Willison
d2daa1b9f7 Database download works again, refactored utils.py #272
Refactored utils.py into a datasette/utils package, refactored some of
the ASGI helper code into datasette/utils/asgi.py
2019-06-23 07:36:54 -07:00
Simon Willison
2b5a644dd7 TestClient obeys allow_redirects again, refs #272 2019-06-23 07:10:42 -07:00
Simon Willison
b7a00dbde3 Include "asgi": "3.0" in /-/versions, refs #272
Mainly so you can tell if a Datasette instance is running
on ASGI or not.
2019-06-23 07:01:38 -07:00
Simon Willison
ff9efa668e Implemente AsgiStream, CSV tests all now pass #272 2019-06-23 06:50:02 -07:00
Simon Willison
eb06e59332 static_mounts mechanism works again, refs #272 2019-06-22 22:42:23 -07:00
Simon Willison
8a1a15d725 Use aiofiles for static, refs #272 2019-06-22 22:07:41 -07:00
Simon Willison
ca03940f6d Basic static files now work, refs #272
Not yet using aiofiles so will not correctly handle larger static assets.

Still needs security tightening.

Still needs tests.

But the CSS and JS now work
2019-06-22 20:58:31 -07:00
Simon Willison
d8dcc34e36 All API tests now pass, refs #272
CSV tests still all fail.

Also I marked test_trace() as skip because I have not yet re-implemented trace.
2019-06-22 20:21:23 -07:00
Simon Willison
55fc993667 Implemented custom 404/500, more tests pass #272 2019-06-22 18:57:10 -07:00
Simon Willison
b53a75c460 Test harness now uses ASGI, some tests pass #272 2019-06-22 18:34:00 -07:00
Simon Willison
180d5be811 First partially working version of ASGI-powered Datasette #272
Lots still to do:

* Static files are not being served
* Streaming CSV files don't work
* Tests all fail
* Some URLs (e.g. the 'next' link on tables) are incorrect

But... the server does start up and you can browse databases/tables
2019-06-22 18:07:44 -07:00
Simon Willison
39d66f17c1 Revert "New encode/decode_path_component functions"
Refs #272

This reverts commit 9fdb47ca95.

Now that ASGI supports raw_path we don't need our own encoding scheme!
2019-06-18 17:24:13 -07:00
Simon Willison
35429f9089 Revert "New encode/decode_path_component functions"
Refs #272

This reverts commit 9fdb47ca95.

Now that ASGI supports raw_path we don't need our own encoding scheme!
2019-06-18 17:23:27 -07:00
Simon Willison
d736411699 Applied black 2019-06-16 08:43:58 -07:00
Simon Willison
7cdc55c683 AsgiRouter and AsgiView WIP 2019-06-15 14:27:11 -07:00
Simon Willison
d4df640d18 Refactored view class hierarchy, refs #272
See https://github.com/simonw/datasette/issues/272#issuecomment-502393107
2019-06-15 12:41:34 -07:00
Tom MacWright
aa911122fe Fix typo in install step: should be install -e (#500) 2019-06-11 11:48:40 -07:00
Simon Willison
6ccfcefb78
Added datasette-render-binary plugin to ecosystem 2019-06-09 09:49:06 -07:00
Simon Willison
0c756b8cd9
Added datasette-bplist plugin to ecosystem 2019-06-08 19:11:59 -07:00
Simon Willison
5e8fbf7f6f
Upgrade pytest to 4.6.1, pluggy to 0.12.0 (#497) 2019-06-02 19:06:26 -07:00
Simon Willison
803f750309
Added datasette-jq plugin to ecosystem 2019-05-29 18:51:10 -07:00
Simon Willison
2a4b892d6c Tidy up with Black 2019-05-27 19:28:47 -07:00
Simon Willison
9c58d048ec Fix pagination when sorted by expanded foreign key
Closes #489
2019-05-27 19:23:18 -07:00
Simon Willison
f069950a14 Removed obsolete __init__ method 2019-05-27 19:03:36 -07:00
Simon Willison
de92c05134 Fixed duplicate function name 2019-05-27 18:49:57 -07:00
Simon Willison
839e55bf0a Start of unit tests for Database class, refs #485 2019-05-27 18:42:30 -07:00
Simon Willison
bd4dbc8519 Rename InterruptedError => QueryInterrupted, closes #490 2019-05-27 17:16:36 -07:00
Simon Willison
edb36629e7 Database.get_outbound_foreign_keys() refactor
Following this, the only module that ever makes calls to the low-level
execute_against_connection_in_thread() method is datasette/database.py
2019-05-27 11:41:44 -07:00
Simon Willison
20f98c3e20 Databse.primary_keys(table) / fts_table(table) refactor, closes #488
Also cleaned up some unused imports spotted by the linter.
2019-05-27 11:27:42 -07:00
Simon Willison
3fe21b91bb Typo 2019-05-27 11:27:21 -07:00