NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #3829 most downloaded on PyPI
A web server and web framework that's written to go fast. Build fast. Run fast.
Last release 4 months ago
31 May 2026
Ships fairly regularly
a new release about every 4 months
Most releases are documented
notes for 53 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
84 releases · first in 2016
## What's Changed * v25 LTS security patch Full Changelog: https://github.com/sanic-org/sanic/compare/v25.12.0...v25.12.1
Full Changelog: https://github.com/sanic-org/sanic/compare/v25.12.0...v25.12.1
Create baseline for bandit to remove false positives by @ChihweiLHBird in https://github.com/sanic-org/sanic/pull/3084
One column per quarter.
WorkerManager by @ChihweiLHBird in https://github.com/sanic-org/sanic/pull/3083Full Changelog: https://github.com/sanic-org/sanic/compare/v25.3.0...v25.12.0
WorkerManager by @ChihweiLHBird in #3083Full Changelog: v25.3.0...v25.12.0
cleanup py3.8 by @erhuabushuo in https://github.com/sanic-org/sanic/pull/3023
Full Changelog: https://github.com/sanic-org/sanic/compare/v24.12.0...v25.3.0
v24 LTS security patch by @ahopkins in https://github.com/sanic-org/sanic/pull/3165
Full Changelog: https://github.com/sanic-org/sanic/compare/v24.6.0...v24.12.1
DOCS: small fix to class name by @vltr in https://github.com/sanic-org/sanic/pull/2888
quiet attribute handling when set to False by @C5H12O5 in https://github.com/sanic-org/sanic/pull/3009setup.cfg by @ChihweiLHBird in https://github.com/sanic-org/sanic/pull/3017get method in the HTTPMethodView class by @ChihweiLHBird in https://github.com/sanic-org/sanic/pull/3016JSONRepsonse dumps callable return type bytes by @imnotjames in https://github.com/sanic-org/sanic/pull/3000mixins.startup.serve UnboundLocalError. by @pygeek in https://github.com/sanic-org/sanic/pull/2992Full Changelog: https://github.com/sanic-org/sanic/compare/v24.6.0...v24.12.0
Fix Websockets Deprecation Warning by @ChihweiLHBird in https://github.com/sanic-org/sanic/pull/2919
request.md by @ilya-nikolaev in https://github.com/sanic-org/sanic/pull/2955.message field on exceptions non-empty by @ekzhang in https://github.com/sanic-org/sanic/pull/2947Full Changelog: https://github.com/sanic-org/sanic/compare/v23.12.0...v24.6.0
request.md by @ilya-nikolaev in #2955.message field on exceptions non-empty by @ekzhang in #2947Full Changelog: v23.12.0...v24.6.0
Fix Docker publish by @prryplatypus in https://github.com/sanic-org/sanic/pull/2887
Full Changelog: https://github.com/sanic-org/sanic/compare/v23.12.1...v23.12.2
Full Changelog: v23.12.1...v23.12.2
Fix broken multiplexer manage by @ahopkins in https://github.com/sanic-org/sanic/pull/2895
Full Changelog: https://github.com/sanic-org/sanic/compare/v23.12.0...v23.12.1
Full Changelog: v23.12.0...v23.12.1
Add constraint for autodocsumm by @prryplatypus in https://github.com/sanic-org/sanic/pull/2807
Current version
websocket.handler.<before/after/exception> signalsSanic.event()Request.scheme for websocket requestsRequest to a Websockets Request for handshakesanic CLItest_fast when there is only one CPURequest to WebSocket Request in websocket_handshake by @ChihweiLHBird in https://github.com/sanic-org/sanic/pull/2858Full Changelog: https://github.com/sanic-org/sanic/compare/v23.6.0...v23.12.0
Current version
websocket.handler.<before/after/exception> signalsSanic.event()Request.scheme for websocket requestsRequest to a Websockets Request for handshakesanic CLItest_fast when there is only one CPURequest to WebSocket Request in websocket_handshake by @ChihweiLHBird in #2858Full Changelog: v23.6.0...v23.12.0
Fix JSONResponse default content type by @prryplatypus in https://github.com/sanic-org/sanic/pull/2737
KEEP_ALIVE_TIMEOUT default to 120 secondsrequest.client_ipJSONREsponse default content typeRequest.get_current in ASGI modeheaders argument of ResponseStream constructor is None by @liamcoatman in https://github.com/sanic-org/sanic/pull/2729Full Changelog: https://github.com/sanic-org/sanic/compare/v23.3.0...v23.6.0
KEEP_ALIVE_TIMEOUT default to 120 secondsrequest.client_ipJSONREsponse default content typeRequest.get_current in ASGI modeheaders argument of ResponseStream constructor is None by @liamcoatman in #2729Full Changelog: v23.3.0...v23.6.0
`sh $ sanic path.to.module:app # global app instance $ sanic path.to.module:create_app # factory pattern $ sanic ./path/to/directory/ # simple serve `
#2545 Standardize init of exceptions for more consistent control of HTTP responses using exceptions
#2606 Decode headers as UTF-8 also in ASGI
#2646 Separate ASGI request and lifespan callables
#2659 Use FALLBACK_ERROR_FORMAT for handlers that return empty()
#2662 Add basic file browser (HTML page) and auto-index serving
#2667 Nicer traceback formatting (HTML page)
#2668 Smarter error page rendering format selection; more reliant upon header and "common sense" defaults
#2680 Check the status of socket before shutting down with SHUT_RDWR
#2687 Refresh Request.accept functionality to be more performant and spec-compliant
#2696 Add header accessors as properties
Example-Field: Foo, Bar
Example-Field: Baz
request.headers.example_field == "Foo, Bar,Baz"
#2700 Simpler CLI targets
$ sanic path.to.module:app # global app instance
$ sanic path.to.module:create_app # factory pattern
$ sanic ./path/to/directory/ # simple serve
#2701 API to define a number of workers in managed processes
#2704 Add convenience for dynamic changes to routing
#2706 Add convenience methods for cookie creation and deletion
response = text("...")
response.add_cookie("test", "It worked!", domain=".yummy-yummy-cookie.com")
#2707 Simplified parse_content_header escaping to be RFC-compliant and remove outdated FF hack
#2710 Stricter charset handling and escaping of request URLs
#2711 Consume body on DELETE by default
#2719 Allow password to be passed to TLS context
#2720 Skip middleware on RequestCancelled
#2721 Change access logging format to %s
#2722 Add CertLoader as application option for directly controlling SSLContext objects
#2725 Worker sync state tolerance on race condition
file when using If-Modified-Since__blueprintname__ property'https' to create the redirectFull Changelog: https://github.com/sanic-org/sanic/compare/v22.12.0...v23.3.0
🚨 *BREAKING CHANGE*: Moves the Inspector to a Sanic app from a simple TCP socket with a custom protocol
JSONResponse class with some convenient methods when updating a response objectuvloop requirement to >=0.15.0websockets v11.0SIGKILL on subsequent ctrl+c to force worker exitspawn for all subprocesses unless specifically set:from sanic import Sanic
Sanic.start_method = "fork"
priority to register_middleware methodunquote to add_route methodtext or bytesStrEnum in Python 3.11+signal.extra--inspect* commands have been deprecated in favor of inspect ... commandsdistutils.strtoboolFull Changelog: https://github.com/sanic-org/sanic/compare/v22.9.1...v22.12.0
docs: sanic now supports windows by @SaidBySolo in https://github.com/sanic-org/sanic/pull/2582
Full Changelog: https://github.com/sanic-org/sanic/compare/v22.9.0...v22.9.1
*See* MDN docs *for more information about when these apply*
WebsocketImplProtocol async iterablepathlib for path resolution (for static file serving)path.parts instead of match (for static file serving)request.is_saferequest.is_idempotentrequest.is_cacheable_static_request_handlerhttp.handler.beforehttp.handler.afterFull Changelog: https://github.com/sanic-org/sanic/compare/v22.6.0...v22.9.0
#2522 Always show server location in ASGI Full Changelog: https://github.com/sanic-org/sanic/compare/v22.6.1...v22.6.2
#2522 Always show server location in ASGI
Full Changelog: https://github.com/sanic-org/sanic/compare/v22.6.1...v22.6.2
Resolves #2477 and #2478 See also #2495 and https://github.com/sanic-org/sanic/security/advisories/GHSA-8cw9-5hmv-77w6
Resolves #2477 and #2478 See also #2495 and https://github.com/sanic-org/sanic/security/advisories/GHSA-8cw9-5hmv-77w6
Full Changelog: https://github.com/sanic-org/sanic/compare/v22.6.0...v22.6.1
👶 *EARLY RELEASE FEATURE*: Serving Sanic over HTTP/3 is an early release feature. It does not yet fully cover the HTTP/3 spec, but instead aims for fe
DEBUG mode
task.cancelBadRequest, MethodNotAllowed, RangeNotSatisfiable)scope as a property on the Request objectfrom sanic import WebsocketRequest.get_formloads functionRequest.get_current()pythonw.exe or places where there is no sys.stdouthttp.lifecycle.request signal in ASGI modeErrorHandlerLOGO settingsanic.response.streamAsyncioServer.initExtendFull Changelog: https://github.com/sanic-org/sanic/compare/v22.3.1...v22.6.0
Resolve warning issue with error handler mismatch warning https://github.com/sanic-org/sanic/commit/3a1a9f071df24e2fe0ff5aac7d529019034fe898
Full Changelog: https://github.com/sanic-org/sanic/compare/v22.3.1...v22.3.2
Add fall back for Windows even loop fetching by @ahopkins in https://github.com/sanic-org/sanic/pull/2421
Full Changelog: https://github.com/sanic-org/sanic/compare/v22.3.0...v22.3.1
🚨 *BREAKING CHANGE*: The old sanic.worker.GunicornWorker has been removed. To run Sanic with gunicorn, you should use it thru uvicorn as described in…
sanic.worker.GunicornWorker has been removed. To run Sanic with gunicorn, you should use it thru uvicorn as described in their docs.Authorization header as Request.credentialsTouchup step in application startupmultidict v0.6<file:ext>, <file:ext=jpg>, <file:ext=jpg|png|gif|svg>, <file=int:ext>, <file=int:ext=jpg|png|gif|svg>, <file=float:ext=tar.gz>
path type matching, and is being released as a beta feature only.register_pattern to accept a str or Patternstrorempty pattern type
/<foo> or /<foo:str>) would match on any string, including empty strings. It will now only match a non-empty string. To retain the old behavior, you should use the new parameter type: /<foo:strorempty>.error_logger on websocketsNone in task registryhost values)debug=True and --debug do NOT automatically run auto_reloadauto looks at headers)config is required for ErrorHandler.finalizeErrorHandler.lookup requires two positional argssanic-routing changesRequest.respondResolves #2477 and #2478 See also #2495 and https://github.com/sanic-org/sanic/security/advisories/GHSA-8cw9-5hmv-77w6
Resolves #2477 and #2478 See also #2495 and https://github.com/sanic-org/sanic/security/advisories/GHSA-8cw9-5hmv-77w6
Full Changelog: https://github.com/sanic-org/sanic/compare/v21.12.1...v21.12.2
- #2349 Only display MOTD on startup - #2354 Add config.update support for all config values - #2355 Ignore name argument in Python 3.7
*BREAKING CHANGE*: If you were manually routing signals there is a breaking change. The signal router's get is no longer 100% determinative. There is…
uvloop by configurationget is no longer 100% determinative. There is now an additional step to loop thru the returned signals for proper matching on the requirements. If signals are being dispatched using app.dispatch or bp.dispatch, there is no change.app.runEnumwebsocket_handshakehttp.lifecyle.response from exception handlerSanic and Blueprint may no longer have arbitrary properties attached to themSanic and Blueprint forced to have compliant names
_ + -_load_env keyword argument of Sanicsanic.exceptions.abortsanic.views.CompositionViewsanic.response.StreamingHTTPResponse
stream() response method (where you pass a callable streaming function) has been deprecated and will be removed in v22.6. You should upgrade all streaming responses to the new style: https://sanicframework.org/en/guide/advanced/streaming.html#response-streaming_Rerelease of v21.9.2 with some cleanup_
Rerelease of v21.9.2 with some cleanup
- #2268 Make HTTP connections start in IDLE stage, avoiding delays and error messages - #2310 More consistent config setting with post-FALLBACK_ERROR_
- #2259 Allow non-conforming ErrorHandlers
## Version 21.9 Release Notes ### Features - #2158, #2248 Complete overhaul of I/O to websockets - #2160 Add new 17 signals into server and request li
auto fallback formatting upon exceptionexception decorator to Blueprint Groupsstatic(..., resource_type="file"))abort() in strategic places to avoid dangling socketsHttpProtocol into a base classserver.py into multi-file module## Bugfixes - #2211 Fix handling of exceptions in ASGI app call
## Bugfixes - #2178 Update sanic-routing to allow for better splitting of complex URI templates - #2183 Proper handling of chunked request bodies to r
sanic-routing to allow for better splitting of complex URI templatesProper differentiation between alpha and string param types
response.eof() method for closing a stream in a handlerCIMultiDict gettersclient_ip access of connection info instanceConfig and Sanic.ctxalpha and string param typesslug param type, example: <foo:slug><foo:string> in favor of <foo:str><foo:number> in favor of <foo:float>route.uri accessorEVENT_AUTOREGISTERSanic() and Blueprint()Blueprint and BlueprintGroupREQUEST_MAX_HEADER_SIZEHTTPMethodView__slots__request.args.pop removes parameters inconsistentlyload_envREQUEST_BUFFER_QUEUE_SIZECompositionView deprecated and marked for removal in 21.12StreamingHTTPResponse## Bugfixes #2117 Add sanic-routing==0.6 with RouteGroup and resolve: - #2116 Access logs not properly displaying body size - #2103 Request body not a
#2117 Add sanic-routing==0.6 with RouteGroup and resolve:
## Bugfixes * #2081 Disable response timeout on websocket connections * #2085 Make sure that blueprints with no slash is maintained when applied
## Bugfixes * #2076 Static files inside subfolders are not accessible (404)
Request.endpoint deprecated in favor of Request.name
Request.id propertyapp.static() helper__str__ and __repr__ to Sanic and Blueprintget_app name argument optionalurl_for where strict_slashes are on for a path ending in /from_envvarfrom_pyfilefrom_objectRequest.endpoint deprecated in favor of Request.namefind_packagesRequest.route property@app.main_process_start@app.main_process_stop@app.before_server_start@app.after_server_start@app.before_server_stop@app.after_server_stop@app.on_request@app.on_responseAllow header that did not include HEADurl_for for a "static" route where name does not existapp.static() without using the named paramurl_for on a file routeunquote in route def (not automatic)routes_all is tuplesrequest.match_info is now a cached (and not computed) propertyapplication/octet-stream_host keyword in url_forutf-8 for text and js content types if not specifiedroutes_static, routes_dynamic, routes_regexBaseSanic metaclasshandle_request_Resolves #2477 and #2478 See also #2495 and https://github.com/sanic-org/sanic/security/advisories/GHSA-8cw9-5hmv-77w6
Resolves #2477 and #2478 See also #2495 and https://github.com/sanic-org/sanic/security/advisories/GHSA-8cw9-5hmv-77w6
Full Changelog: https://github.com/sanic-org/sanic/compare/v20.12.6...v20.12.7
Potential server crash if running Python 3.10 w/ Sanic 20.12 by @ahopkins in https://github.com/sanic-org/sanic/pull/2400
Full Changelog: https://github.com/sanic-org/sanic/compare/v20.12.5...v20.12.6
#2366 Upgrade websockets version - SECURITY UPDATE
#2366 Upgrade websockets version - SECURITY UPDATE
Nothing published for this version
# Version 20.12.3 ## Bugfixes * #2021 Remove prefix from websocket handler name
## Dependencies - #2026 Fix uvloop to 0.14 because 0.15 drops Python 3.6 support - #2029 Remove old chardet requirement, add in hard multidict require
## Features - #1993 Add disable app registry
[\#1981][] Cleanup and remove deprecated code
#### Bugfixes * #1957 Removes duplicate headers in ASGI streaming body * #1954 Fix static route registration on blueprints
#### Features * #1887 Pass subprotocols in websockets (both sanic server and ASGI) * #1894 Automatically set test_mode flag on app instance * #1903 Ad
test_mode flag on app instance#### Bugfixes * #1884 Socket binding implemented properly for IPv6 and UNIX sockets
#### Features * #1641 Socket binding implemented properly for IPv6 and UNIX sockets
#### Features * #1760 Add version parameter to websocket routes * #1866 Add sanic as an entry point command * #1880 Add handler names for websockets f
#1760 Add version parameter to websocket routes
#1866 Add sanic as an entry point command
#1880 Add handler names for websockets for url_for usage
#1776 Bug fix for host parameter issue with lists
#1842 Fix static _handler pickling error
#1827 Fix reloader on OSX py38 and Windows
#1848 Reverse named_response_middlware execution order, to match normal response middleware execution order
#1853 Fix pickle error when attempting to pickle an application which contains websocket routes
#1852 Fix naming of CI test env on Python nightlies
#1857 Adjust websockets version to setup.py
#1869 Wrap run()'s "protocol" type annotation in Optional[]
Nothing published for this version
ChangeLogs: https://github.com/huge-success/sanic/blob/master/CHANGELOG.rst#version-2030
ChangeLogs: https://github.com/huge-success/sanic/blob/master/CHANGELOG.rst#version-2030
## Dependencies - #2025 Fix uvloop to 0.14 because 0.15 drops Python 3.6 support - #2027 Remove old chardet requirement, add in hard multidict require
Nothing published for this version
#### Bugfixes * #1959 Removes duplicate headers in ASGI streaming body
Resolve forgotten slot, see #1743
Resolve forgotten slot, see #1743
Major changes to bring sanic up to current. Please consult the changelog. There are breaking changes in this release; please continue to use 19.9.X or…
19.12.0 LTS
Major changes to bring sanic up to current. Please consult the changelog. There are breaking changes in this release; please continue to use 19.9.X or the previous 18.12.X LTS release which will continued to be supported until December 2021 for stability.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Sanic 19.6.0 is a standard release based on the CalVer versioning adopted in 2018.
Sanic 19.6.0 is a standard release based on the CalVer versioning adopted in 2018.
Changes: #1475 ASGI support (Beta) #1436 Add Configure support from object string #1544 Drop dependency on distutil #1562 Switch to use request-async for test_client from aiohttp
Fixes: #1587 Add missing handler for Expect header. #1560 Allow to disable Transfer-Encoding: chunked. #1558 Fix graceful shutdown. #1594 Fix strict slashes behavior.
Deprecations: #1568 Deprecate route removal. #1562 Drop Python3.5 support.
Nothing published for this version
Improved codebase test coverage from 81% to 91%.
Improved codebase test coverage from 81% to 91%.
Added stream_large_files and host examples in static_file document
Added methods to append and finish body content on Request (#1379)
Integrated with .appveyor.yml for windows ci support
Added documentation for AF_INET6 and AF_UNIX socket usage
Adopt black/isort for codestyle
Cancel task when connection_lost
Simplify request ip and port retrieval logic
Handle config error in load config file.
Integrate with codecov for CI
Add missed documentation for config section.
Deprecate Handler.log
Pinned httptools requirement to version 0.0.10+
Fixes:
remove_entity_headers helper function (#1415)http module to helpers to prevent conflicts with the built-in Python http library (fixes #1323)Your coding agent can read these notes before it upgrades. Set up the MCP server →