Browse Source

Remove code examples for Python 3.8 in `templates`

pull/14510/head
Yurii Motov 7 months ago
parent
commit
0d92a8257b
  1. 2
      docs/en/docs/advanced/templates.md
  2. 0
      docs_src/templates/tutorial001_py39.py
  3. 2
      tests/test_tutorial/test_templates/test_tutorial001.py

2
docs/en/docs/advanced/templates.md

@ -27,7 +27,7 @@ $ pip install jinja2
* Declare a `Request` parameter in the *path operation* that will return a template.
* Use the `templates` you created to render and return a `TemplateResponse`, pass the name of the template, the request object, and a "context" dictionary with key-value pairs to be used inside of the Jinja2 template.
{* ../../docs_src/templates/tutorial001.py hl[4,11,15:18] *}
{* ../../docs_src/templates/tutorial001_py39.py hl[4,11,15:18] *}
/// note

0
docs_src/templates/tutorial001.py → docs_src/templates/tutorial001_py39.py

2
tests/test_tutorial/test_templates/test_tutorial001.py

@ -11,7 +11,7 @@ def test_main():
shutil.rmtree("./templates")
shutil.copytree("./docs_src/templates/templates/", "./templates")
shutil.copytree("./docs_src/templates/static/", "./static")
from docs_src.templates.tutorial001 import app
from docs_src.templates.tutorial001_py39 import app
client = TestClient(app)
response = client.get("/items/foo")

Loading…
Cancel
Save