-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New translations v24.12.md (Chinese Simplified)
- Loading branch information
Showing
1 changed file
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
--- | ||
title: 24.12 版本 | ||
--- | ||
|
||
# 24.12 版本 | ||
|
||
.. toc:: | ||
|
||
## 一. 导言 | ||
|
||
这是版本 24 [发行周期] (../../organization/policies.md#release-schedule) 的第一次版本。 与过去几年相比,释放24人的队伍可能略有改变。 请确保在Discord服务器上更新最新信息。 如果您遇到任何问题,请在 [GitHub](https://github.com/sanic-org/sanic/issues/new/selecte) 上提出一个问题。 | ||
|
||
## 了解什么 | ||
|
||
更多详细信息在 [Changelog](../changelog.html)。 显著的新功能或破损功能以及升级内容: | ||
|
||
### 👶 _BETA_自定义 CLI 命令 | ||
|
||
现在`sanic` CLI 实用程序允许调用自定义命令。 命令可以使用下面的装饰符语法添加。 | ||
|
||
```python | ||
@app.command | ||
async def foo(one, two: str, three: str = "..."): | ||
logger.info(f"FOO {one=} {two=} {three=}") | ||
|
||
|
||
@app.command | ||
def bar(): | ||
logger.info("BAR") | ||
|
||
|
||
@app.command(name="qqq") | ||
async def baz(): | ||
logger.info("BAZ") | ||
``` | ||
|
||
这些命令使用下面的`exec`命令。 | ||
|
||
```sh | ||
sanic server:app exec <command> [--arg=value] | ||
``` | ||
|
||
函数签名中的任何参数都将作为参数添加。 例如: | ||
|
||
```sh | ||
sanic server:app exec command --one=1 --two=2 --three=3 | ||
``` | ||
|
||
.. 警告:: | ||
|
||
``` | ||
This is in **BETA** and the functionality is subject to change in upcoming versions. | ||
``` | ||
|
||
### 添加 Python 3.13 支持 | ||
|
||
我们已经将 Python 3.13 添加到支持的版本。 | ||
|
||
### 删除 Python 3.8 支持 | ||
|
||
Python 3.8寿命终结。 Sanic 正在放弃对 Python 3.8的支持,需要 Python 3.9 或更高版本。 | ||
|
||
### 旧响应 cookie 存取器已删除 | ||
|
||
在 v23 之前,在 "Response" 对象上的 cookie 被设置为字典对象并被访问。 在 v23.3 中添加了新的 [方便方法] (../2023/v23.3.html#more-facilent-methods-for-setting-deleting-cookies)时,这种做法被废弃。 旧模式已被移除。 | ||
|
||
## 谢谢你 | ||
|
||
Thank you to everyone that participated in this release: :clap: | ||
|
||
[@ahopkins](https://github.com/ahopkins) | ||
[@C5H12O5](https://github.com/C5H12O5) | ||
[@ChihweiLHBird](https://github.com/ChihweiLHBird) | ||
[@HyperKiko](https://github.com/HyperKiko) | ||
[@imnotjames](https://github.com/imnotjames) | ||
[@pygeek](https://github.com/pygeek) | ||
|
||
--- | ||
|
||
如果您喜欢这个项目,请考虑捐款。 当然,我们喜欢代码贡献,但我们也喜欢任何形式的贡献。 考虑撰写一些文档,显示关闭的情况,加入对话并让您的声音为人所知,如果您能够:[金融贡献](https://opencollective.com/sanic-org/)。 |