Commit Graph

147 Commits

Author SHA1 Message Date
Marcos Schroh d36499526d Missing annotations added on staticfiles module (#70)
* fix(Missing annotation): missing annotations added on staticfiles module.

* fix(staticfiles annotations): annotations fixed.

* refactor(staticfiles): only instanciate a class when is necessary.
2018-10-02 19:06:34 +01:00
Tom Christie bc66a872e9 Version 0.3.3 2018-10-02 13:31:09 +01:00
Tom Christie a24ba66556 Type hinting 2018-10-02 13:24:02 +01:00
Marcos Schroh 041381e40c Missing annotations on websockets module. (#69)
* fix(Missing annotation): missing annotations added on websockets module.

* fix(websockets annotations): implied optionals should be used.
2018-10-02 13:15:33 +01:00
Tom Christie 6d2e9f4fae replace -> replace_components (Avoid clashing with str builtin) 2018-10-02 13:13:16 +01:00
Marcos Schroh 7eafe567df Missing annotations added datastructures & requests modules (#60)
* fix(dataStructures): missing annotations added

* fix(requests.py): annotations added

* fix(Annotations): wrong annotations fixed on datastructures and requests modules.
2018-10-02 12:31:05 +01:00
Tom Christie 7dc07267c2 Update background task tests 2018-10-02 12:29:44 +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
Marcos Schroh df2985f50e Missing annotations debug module (#68)
* fix(Missing annotation): missing annotations added on debug module.

* fix(debug.py): linting fixed.

* fix(debug annotations): annotations fixed.

* fix(): ASGIInstance annotation type should be used on return of _DebugResponder __call__ method.

* fix(): Exception type should be used instead of Any.
2018-09-28 10:41:22 +01:00
Marcos Schroh 29c53d5a54 fix(Missing annotation): missing annotations added on endpoints module. (#72) 2018-09-27 10:19:21 +01:00
Marcos Schroh a24aa3dfe7 fix(Missing annotation): missing annotations added on routing module. (#71) 2018-09-26 15:30:38 +01:00
Tom Christie 12e4ef60d7
Add link to latest TechEmpower benchmarks (#61) 2018-09-20 10:00:25 +01:00
Tom Christie fb74074b3f Black formatting 2018-09-18 11:03:18 +01:00
Tom Christie 75776b45cd Version 0.3.2 2018-09-17 14:59:21 +01:00
Tom Christie c3fc0cf6ea Ensure TestClient sets HTTP reason phrase 2018-09-17 14:59:09 +01:00
Tom Christie 16d41e6def Version 0.3.1 2018-09-14 10:21:40 +01:00
Tom Christie a7e72c1c1d Add methods= to app.route 2018-09-14 10:19:26 +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 9871fa6e30 Version 0.2.3 2018-09-04 11:54:04 +01:00
Tom Christie d6bc4b89ce Version 0.2.2 2018-09-04 11:53:06 +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 764b126839 Version 0.2.1 2018-08-30 13:54:24 +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 4549d625f9 Make docs link more prominent 2018-08-29 11:33:59 +01:00
Tom Christie 6b6b818a00 Move documentation out of README 2018-08-29 11:31:32 +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
Tom Christie 25990db22e Add mkdocs 2018-08-28 16:25:32 +01:00
Tom Christie 1bcf516d44 Fix typo 2018-08-28 16:24:18 +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 9cfb1af592 Merge branch 'master' into mkdocs 2018-08-28 08:09:42 -06:00
Jeff Buttars bb6a8fb7c9 Initial conversion of README.md to mkdocs 2018-08-28 07:58:03 -06:00
Tom Christie 0b4acd4432 Version 0.2 2018-08-28 14:46:47 +01:00
Tom Christie 1e78ddb45c Black formatting 2018-08-28 14:45:50 +01:00
Tom Christie 779516a5ac Fixes to TestClient websocket docs 2018-08-28 14:45:23 +01:00
Tom Christie 2519f83765 client.wsconnect -> client.websocket_connect 2018-08-28 14:45:06 +01:00
Tom Christie 00a972c719
Add App class (#42)
* Add App class

* Black formatting

* Support kwargs in App routes

* Black formatting

* Use protocol based routing in app

* WebSocket close when no route found

* session.send(...), session.receive(...) for test client

* Support app.mount(prefix, app)

* Black formatting

* Black formatting

* Minor tweaks to websocket test client

* Add 'App' to README
2018-08-28 14:34:18 +01:00
Tom Christie 78fae57bc3 Update table of contents 2018-08-27 15:42:05 +01:00
Jeff Buttars 99fd15e380 Add a TOC to the repo README (#40) 2018-08-27 15:38:56 +01:00
Tom Christie 828ee47483
Drop asgi_application decorator (#41) 2018-08-27 15:38:44 +01:00
Tom Christie cb9fc8746b
Redirect response (#39)
* Minor Request cleanups

* Black formatting

* Add RedirectResponse

* Black formatting

* Clean up test_redirect_response test case
2018-08-27 14:51:24 +01:00