From 03a4a2345a5b975d477b8ca800276c2d7b992a9c Mon Sep 17 00:00:00 2001 From: GitHub Action <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 09:01:53 +0000 Subject: [PATCH] Deployed 28991b7 with MkDocs version: 1.6.1 --- .nojekyll | 0 404.html | 877 +++ CNAME | 1 + applications/index.html | 1312 ++++ assets/_mkdocstrings.css | 143 + assets/images/favicon.png | Bin 0 -> 1870 bytes assets/javascripts/bundle.83f73b43.min.js | 16 + assets/javascripts/bundle.83f73b43.min.js.map | 7 + assets/javascripts/lunr/min/lunr.ar.min.js | 1 + assets/javascripts/lunr/min/lunr.da.min.js | 18 + assets/javascripts/lunr/min/lunr.de.min.js | 18 + assets/javascripts/lunr/min/lunr.du.min.js | 18 + assets/javascripts/lunr/min/lunr.el.min.js | 1 + assets/javascripts/lunr/min/lunr.es.min.js | 18 + assets/javascripts/lunr/min/lunr.fi.min.js | 18 + assets/javascripts/lunr/min/lunr.fr.min.js | 18 + assets/javascripts/lunr/min/lunr.he.min.js | 1 + assets/javascripts/lunr/min/lunr.hi.min.js | 1 + assets/javascripts/lunr/min/lunr.hu.min.js | 18 + assets/javascripts/lunr/min/lunr.hy.min.js | 1 + assets/javascripts/lunr/min/lunr.it.min.js | 18 + assets/javascripts/lunr/min/lunr.ja.min.js | 1 + assets/javascripts/lunr/min/lunr.jp.min.js | 1 + assets/javascripts/lunr/min/lunr.kn.min.js | 1 + assets/javascripts/lunr/min/lunr.ko.min.js | 1 + assets/javascripts/lunr/min/lunr.multi.min.js | 1 + assets/javascripts/lunr/min/lunr.nl.min.js | 18 + assets/javascripts/lunr/min/lunr.no.min.js | 18 + assets/javascripts/lunr/min/lunr.pt.min.js | 18 + assets/javascripts/lunr/min/lunr.ro.min.js | 18 + assets/javascripts/lunr/min/lunr.ru.min.js | 18 + assets/javascripts/lunr/min/lunr.sa.min.js | 1 + .../lunr/min/lunr.stemmer.support.min.js | 1 + assets/javascripts/lunr/min/lunr.sv.min.js | 18 + assets/javascripts/lunr/min/lunr.ta.min.js | 1 + assets/javascripts/lunr/min/lunr.te.min.js | 1 + assets/javascripts/lunr/min/lunr.th.min.js | 1 + assets/javascripts/lunr/min/lunr.tr.min.js | 18 + assets/javascripts/lunr/min/lunr.vi.min.js | 1 + assets/javascripts/lunr/min/lunr.zh.min.js | 1 + assets/javascripts/lunr/tinyseg.js | 206 + assets/javascripts/lunr/wordcut.js | 6708 +++++++++++++++++ .../workers/search.6ce7567c.min.js | 42 + .../workers/search.6ce7567c.min.js.map | 7 + assets/stylesheets/main.6f8fc17f.min.css | 1 + assets/stylesheets/main.6f8fc17f.min.css.map | 1 + assets/stylesheets/palette.06af60db.min.css | 1 + .../stylesheets/palette.06af60db.min.css.map | 1 + authentication/index.html | 1215 +++ background/index.html | 1068 +++ config/index.html | 1283 ++++ contributing/index.html | 1302 ++++ database/index.html | 1317 ++++ endpoints/index.html | 1132 +++ exceptions/index.html | 1143 +++ graphql/index.html | 920 +++ img/gh-actions-fail-check.png | Bin 0 -> 971165 bytes img/gh-actions-fail-test.png | Bin 0 -> 1336330 bytes img/gh-actions-fail.png | Bin 0 -> 346190 bytes img/starlette.svg | 1 + img/starlette_dark.svg | 1 + index.html | 1172 +++ lifespan/index.html | 1078 +++ middleware/index.html | 2749 +++++++ objects.inv | Bin 0 -> 176 bytes overrides/partials/toc-item.html | 18 + release-notes/index.html | 5406 +++++++++++++ requests/index.html | 1373 ++++ responses/index.html | 1420 ++++ routing/index.html | 1429 ++++ schemas/index.html | 1101 +++ search/search_index.json | 1 + server-push/index.html | 1008 +++ sitemap.xml | 95 + sitemap.xml.gz | Bin 0 -> 360 bytes staticfiles/index.html | 1028 +++ templates/index.html | 1243 +++ testclient/index.html | 1295 ++++ third-party-packages/index.html | 2035 +++++ websockets/index.html | 1345 ++++ 80 files changed, 42788 insertions(+) create mode 100644 .nojekyll create mode 100644 404.html create mode 100644 CNAME create mode 100644 applications/index.html create mode 100644 assets/_mkdocstrings.css create mode 100644 assets/images/favicon.png create mode 100644 assets/javascripts/bundle.83f73b43.min.js create mode 100644 assets/javascripts/bundle.83f73b43.min.js.map create mode 100644 assets/javascripts/lunr/min/lunr.ar.min.js create mode 100644 assets/javascripts/lunr/min/lunr.da.min.js create mode 100644 assets/javascripts/lunr/min/lunr.de.min.js create mode 100644 assets/javascripts/lunr/min/lunr.du.min.js create mode 100644 assets/javascripts/lunr/min/lunr.el.min.js create mode 100644 assets/javascripts/lunr/min/lunr.es.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.he.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hu.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hy.min.js create mode 100644 assets/javascripts/lunr/min/lunr.it.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ja.min.js create mode 100644 assets/javascripts/lunr/min/lunr.jp.min.js create mode 100644 assets/javascripts/lunr/min/lunr.kn.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ko.min.js create mode 100644 assets/javascripts/lunr/min/lunr.multi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.nl.min.js create mode 100644 assets/javascripts/lunr/min/lunr.no.min.js create mode 100644 assets/javascripts/lunr/min/lunr.pt.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ro.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ru.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sa.min.js create mode 100644 assets/javascripts/lunr/min/lunr.stemmer.support.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sv.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ta.min.js create mode 100644 assets/javascripts/lunr/min/lunr.te.min.js create mode 100644 assets/javascripts/lunr/min/lunr.th.min.js create mode 100644 assets/javascripts/lunr/min/lunr.tr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.vi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.zh.min.js create mode 100644 assets/javascripts/lunr/tinyseg.js create mode 100644 assets/javascripts/lunr/wordcut.js create mode 100644 assets/javascripts/workers/search.6ce7567c.min.js create mode 100644 assets/javascripts/workers/search.6ce7567c.min.js.map create mode 100644 assets/stylesheets/main.6f8fc17f.min.css create mode 100644 assets/stylesheets/main.6f8fc17f.min.css.map create mode 100644 assets/stylesheets/palette.06af60db.min.css create mode 100644 assets/stylesheets/palette.06af60db.min.css.map create mode 100644 authentication/index.html create mode 100644 background/index.html create mode 100644 config/index.html create mode 100644 contributing/index.html create mode 100644 database/index.html create mode 100644 endpoints/index.html create mode 100644 exceptions/index.html create mode 100644 graphql/index.html create mode 100644 img/gh-actions-fail-check.png create mode 100644 img/gh-actions-fail-test.png create mode 100644 img/gh-actions-fail.png create mode 100644 img/starlette.svg create mode 100644 img/starlette_dark.svg create mode 100644 index.html create mode 100644 lifespan/index.html create mode 100644 middleware/index.html create mode 100644 objects.inv create mode 100644 overrides/partials/toc-item.html create mode 100644 release-notes/index.html create mode 100644 requests/index.html create mode 100644 responses/index.html create mode 100644 routing/index.html create mode 100644 schemas/index.html create mode 100644 search/search_index.json create mode 100644 server-push/index.html create mode 100644 sitemap.xml create mode 100644 sitemap.xml.gz create mode 100644 staticfiles/index.html create mode 100644 templates/index.html create mode 100644 testclient/index.html create mode 100644 third-party-packages/index.html create mode 100644 websockets/index.html diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/404.html b/404.html new file mode 100644 index 000000000..2f1dc5b1e --- /dev/null +++ b/404.html @@ -0,0 +1,877 @@ + + + +
+ + + + + + + + + + + + + + + + +Starlette includes an application class Starlette
that nicely ties together all of
+its other functionality.
from contextlib import asynccontextmanager
+
+from starlette.applications import Starlette
+from starlette.responses import PlainTextResponse
+from starlette.routing import Route, Mount, WebSocketRoute
+from starlette.staticfiles import StaticFiles
+
+
+def homepage(request):
+ return PlainTextResponse('Hello, world!')
+
+def user_me(request):
+ username = "John Doe"
+ return PlainTextResponse('Hello, %s!' % username)
+
+def user(request):
+ username = request.path_params['username']
+ return PlainTextResponse('Hello, %s!' % username)
+
+async def websocket_endpoint(websocket):
+ await websocket.accept()
+ await websocket.send_text('Hello, websocket!')
+ await websocket.close()
+
+@asynccontextmanager
+async def lifespan(app):
+ print('Startup')
+ yield
+ print('Shutdown')
+
+
+routes = [
+ Route('/', homepage),
+ Route('/user/me', user_me),
+ Route('/user/{username}', user),
+ WebSocketRoute('/ws', websocket_endpoint),
+ Mount('/static', StaticFiles(directory="static")),
+]
+
+app = Starlette(debug=True, routes=routes, lifespan=lifespan)
+
Starlette(debug: bool = False, routes: Sequence[BaseRoute] | None = None, middleware: Sequence[Middleware] | None = None, exception_handlers: Mapping[Any, ExceptionHandler] | None = None, on_startup: Sequence[Callable[[], Any]] | None = None, on_shutdown: Sequence[Callable[[], Any]] | None = None, lifespan: Lifespan[AppType] | None = None)
+
Creates an Starlette application.
+ + + +Parameters:
+debug
+ (bool
, default:
+ False
+)
+ –
+ Boolean indicating if debug tracebacks should be returned on errors.
+routes
+ (Sequence[BaseRoute] | None
, default:
+ None
+)
+ –
+ A list of routes to serve incoming HTTP and WebSocket requests.
+middleware
+ (Sequence[Middleware] | None
, default:
+ None
+)
+ –
+ A list of middleware to run for every request. A starlette
+application will always automatically include two middleware classes.
+ServerErrorMiddleware
is added as the very outermost middleware, to handle
+any uncaught errors occurring anywhere in the entire stack.
+ExceptionMiddleware
is added as the very innermost middleware, to deal
+with handled exception cases occurring in the routing or endpoints.
exception_handlers
+ (Mapping[Any, ExceptionHandler] | None
, default:
+ None
+)
+ –
+ A mapping of either integer status codes,
+or exception class types onto callables which handle the exceptions.
+Exception handler callables should be of the form
+handler(request, exc) -> response
and may be either standard functions, or
+async functions.
on_startup
+ (Sequence[Callable[[], Any]] | None
, default:
+ None
+)
+ –
+ A list of callables to run on application startup. +Startup handler callables do not take any arguments, and may be either +standard functions, or async functions.
+on_shutdown
+ (Sequence[Callable[[], Any]] | None
, default:
+ None
+)
+ –
+ A list of callables to run on application shutdown. +Shutdown handler callables do not take any arguments, and may be either +standard functions, or async functions.
+lifespan
+ (Lifespan[AppType] | None
, default:
+ None
+)
+ –
+ A lifespan context function, which can be used to perform
+startup and shutdown tasks. This is a newer style that replaces the
+on_startup
and on_shutdown
handlers. Use one or the other, not both.
starlette/applications.py
30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 |
|
You can store arbitrary extra state on the application instance, using the
+generic app.state
attribute.
For example:
+app.state.ADMIN_EMAIL = 'admin@example.org'
+
Where a request
is available (i.e. endpoints and middleware), the app is available on request.app
.