Commit Graph

37 Commits

Author SHA1 Message Date
Tom Christie fa2a5a8070 Include 'add_graphql_route' 2018-10-18 17:06:17 +01:00
Tom Christie 137c2ab70e Add 'app.add_graphql_route()' 2018-10-18 16:58:49 +01:00
Tom Christie c0f9f60ae9 Add graphiql support 2018-10-18 15:24:26 +01:00
Tom Christie 315a21be85
GraphQL support (#126)
* GraphQL support

* GraphQL support

* Run GraphQL queries inside a threadpool

* Support AsyncioExecutor

* GraphQL error formatting

* Docs for GraphQL support
2018-10-18 14:45:18 +01:00
Alexander Botello 88fe1799c7 Fix example import statement (#123) 2018-10-18 08:38:07 +01:00
Tom Christie 07581a7dd6 Tweak to cookie docs 2018-10-17 11:17:07 +01:00
Alexander Botello 4dedf7ce96 Add documentation for cookies (#116)
* Add cookies to request docs

* Add cookies to response docs

* Reformat the postion of methods
2018-10-17 11:15:32 +01:00
Tom Christie 65704a8083 Note zero hard dependencies 2018-10-17 09:00:45 +01:00
Tom Christie b829248e7d Add feature list to README/docs 2018-10-16 16:10:24 +01:00
Tom Christie 097152be5a
Add GZip middleware (#111) 2018-10-15 12:08:10 +01:00
Tom Christie c43a070eed
Form parsing (#102)
* Work towards MultiPartParser

* Work towards MultiPartParser

* Add test for multipart files

* MultiPart parsing

* Fix for large multipart messages

* Add python-multipart to docs

* Add python-multipart to 'pip install starlette[full]'

* Add FormParser

* Add docs for request.form()

* Drop mypy momentarily
2018-10-12 18:15:04 +01:00
Tom Christie 09ce2c373a Version 0.4.0 2018-10-10 17:12:58 +01:00
Tom Christie 139753f857
Add support for `app.on_event("startup")` and `app.on_event("cleanup")`. (#98)
* Push black linting into ./scripts/test Fix some annotations etc.

* Skip black on 3.7

* Fix script

* Blergh. Shell equality tests are weird

* Attempt to fix equality check

* Document 'allow_origin_regex'

* Support app.on_event('startup') and app.on_event('cleanup')

* Nicer decorator handling for on_event

* Add documentation for app.on_event()
2018-10-09 15:47:51 +01:00
Karan Suthar 27fc98b58b unicorn command correction in docs (#97) 2018-10-09 12:41:53 +01:00
Tom Christie c98c15005e
Middleware and CORS support (#83)
* Tweaks to URL datastructure

* Linting

* Add Middleware

* Type annotations

* CORS support

* Add CORS support

* Fix code example
2018-10-05 16:38:02 +01:00
Tom Christie 19670ae2cd
Middleware (#82)
* Tweaks to URL datastructure

* Linting

* Add Middleware
2018-10-05 12:04:11 +01:00
Tom Christie 94044e5991
Tweaks to URL datastructure (#81)
* Tweaks to URL datastructure

* Linting
2018-10-05 11:29:06 +01:00
Tom Christie ee32830003 Minor tweaks to background task docs 2018-10-02 11:47:49 +01:00
Alex Botello 7c1a1e9dd5 Add support for background tasks (#65)
* Build out a BackgroundTask class

* Integrate BackgroundTask into Response class

* Add test cases for background tasks

* Add documentation for background tasks

* Reformat files with black

* Make requested changes

* Improve documentation example
2018-10-02 11:40:08 +01:00
Tom Christie 4c7e79f4e7 Minor tweaks to WS docs 2018-10-02 11:30:54 +01:00
Jordan Eremieff 1ce4c89149 Class-based websocket handler (#62)
* WebSocketEndpoint class, docs, tests.

* Refactor WebSocketEndpoint class to only store scope. Update WebSocketEndpoint docs example and tests.

* Add decode method to WebSocketEndpoint, update docs, update tests
2018-10-02 11:26:19 +01:00
Tom Christie a7722cd245 Minor changes to docs layout 2018-09-05 13:45:39 +01:00
Tom Christie 0d2e7e13d3 Fix imports in docs 2018-09-05 12:50:00 +01:00
Tom Christie e6cd2d7e86 Tweak example: access logs on, port 8000 2018-09-05 11:44:54 +01:00
Tom Christie 78d1829758
Version 0.3 (#57)
* Renamings

* Version 0.3.0

* Black formatting

* Update docs for 0.3
2018-09-05 11:39:38 +01:00
Jordan Eremieff f4fe0ec312 Name changes (#55)
* Rename View -> HTTPEndpoint

* Rename views doc file -> endpoints

* Rename request/response files -> requests/responses, update imports, update docs

* Rename WebSocketSession -> WebSocket, rename session -> websocket in docs

* Full module imports in tests and source, removing imports from __init__ file

* Fix name in testclient doc
2018-09-05 10:29:04 +01:00
Tom Christie 67d95fcfa7
Exception handling (#54)
* Exception handling

* Black formatting

* Add exception handling to App

* Handle cases where exception raised but response already started

* Order exception handler lookup by class inheritance

* Handle 404/405 as responses without App, or exceptions with it.

* Only use TestClient(app, raise_exceptions=False) explicitly inside test cases

* Documentation for ExceptionMiddleware

* Drop error_handler/exception_handler distinction.

* Finesse and document TestClient(app, raise_server_exceptions=False)

* Refactoring to make debug responses easier to obtain from elsewhere in code

* Use named status_code argument in example

* Clean up raise_server_errors usage in tests

* Consistent title-casing in HTTP reason phrases

* Black formatting

* Add WebSocketClose close. Omit message-body on 204, 304 exception cases.

* Black formatting

* Add 'debug' flag to App and ExceptionMiddleware

* Support app.debug

* Document debug mode

* Documenting debug
2018-09-04 11:52:29 +01:00
Tom Christie 8245768f81
Use 405 for Method Not Allowed (#53) 2018-08-30 14:42:39 +01:00
Tom Christie 0693a8f6c9
Class based views (#52)
* Renaming asgi_application, implementing CBV pattern, add_route method on router

* Refactor view to allow both sync/async methods

* Type hints for CBV

* Implement asgi decorator method directly in view class, remove classmethod

* Refactor CBV, remove router add_route method in favor of App.add_route method, tests, documentation

* Include tests

* Add support for class-based views
2018-08-30 13:53:37 +01:00
Tom Christie 2002eb1bd2 Drop licence footer from page content 2018-08-29 11:31:08 +01:00
Tom Christie 352ccda556 Update docs 2018-08-29 11:17:09 +01:00
Jeff Buttars 774e78d269 Update test_client doc from README.md 2018-08-28 08:18:17 -06:00
Jeff Buttars 1f6fabc5e1 Add Applications docs to mkdocs 2018-08-28 08:11:53 -06:00
Jeff Buttars bb6a8fb7c9 Initial conversion of README.md to mkdocs 2018-08-28 07:58:03 -06:00
Tom Christie f42f2aadd9 Tweak header image 2018-07-02 12:00:03 +01:00
Tom Christie b2c8c6c81f Tweak header image 2018-07-02 11:57:44 +01:00
Tom Christie a5bb58b9b6 README image 2018-07-02 11:52:33 +01:00