Browse Source

Remove `www.` to prevent redirects

pull/15967/head
Yurii Motov 2 weeks ago
parent
commit
717e1ca3c7
  1. 6
      README.md
  2. 2
      docs/en/docs/advanced/events.md
  3. 2
      docs/en/docs/advanced/middleware.md
  4. 2
      docs/en/docs/advanced/response-cookies.md
  5. 2
      docs/en/docs/advanced/response-headers.md
  6. 2
      docs/en/docs/advanced/templates.md
  7. 2
      docs/en/docs/advanced/testing-events.md
  8. 2
      docs/en/docs/advanced/testing-websockets.md
  9. 4
      docs/en/docs/advanced/using-request-directly.md
  10. 4
      docs/en/docs/advanced/websockets.md
  11. 4
      docs/en/docs/alternatives.md
  12. 2
      docs/en/docs/deployment/manually.md
  13. 2
      docs/en/docs/fastapi-cli.md
  14. 2
      docs/en/docs/features.md
  15. 2
      docs/en/docs/history-design-future.md
  16. 2
      docs/en/docs/how-to/custom-request-and-route.md
  17. 6
      docs/en/docs/index.md
  18. 2
      docs/en/docs/release-notes.md
  19. 4
      docs/en/docs/tutorial/background-tasks.md
  20. 2
      docs/en/docs/tutorial/first-steps.md
  21. 2
      docs/en/docs/tutorial/handling-errors.md
  22. 2
      docs/en/docs/tutorial/middleware.md
  23. 2
      docs/en/docs/tutorial/static-files.md
  24. 2
      docs/en/docs/tutorial/testing.md
  25. 4
      fastapi/applications.py

6
README.md

@ -129,7 +129,7 @@ If you are building a <abbr title="Command Line Interface">CLI</abbr> app to be
FastAPI stands on the shoulders of giants: FastAPI stands on the shoulders of giants:
* [Starlette](https://www.starlette.dev/) for the web parts. * [Starlette](https://starlette.dev/) for the web parts.
* [Pydantic](https://docs.pydantic.dev/) for the data parts. * [Pydantic](https://docs.pydantic.dev/) for the data parts.
## Installation ## Installation
@ -231,7 +231,7 @@ INFO: Application startup complete.
<details markdown="1"> <details markdown="1">
<summary>About the command <code>fastapi dev</code>...</summary> <summary>About the command <code>fastapi dev</code>...</summary>
The command `fastapi dev` reads your `main.py` file automatically, detects the **FastAPI** app in it, and starts a server using [Uvicorn](https://www.uvicorn.dev). The command `fastapi dev` reads your `main.py` file automatically, detects the **FastAPI** app in it, and starts a server using [Uvicorn](https://uvicorn.dev).
By default, `fastapi dev` will start with auto-reload enabled for local development. By default, `fastapi dev` will start with auto-reload enabled for local development.
@ -508,7 +508,7 @@ Used by Starlette:
Used by FastAPI: Used by FastAPI:
* [`uvicorn`](https://www.uvicorn.dev) - for the server that loads and serves your application. This includes `uvicorn[standard]`, which includes some dependencies (e.g. `uvloop`) needed for high performance serving. * [`uvicorn`](https://uvicorn.dev) - for the server that loads and serves your application. This includes `uvicorn[standard]`, which includes some dependencies (e.g. `uvloop`) needed for high performance serving.
* `fastapi-cli[standard]` - to provide the `fastapi` command. * `fastapi-cli[standard]` - to provide the `fastapi` command.
* This includes `fastapi-cloud-cli`, which allows you to deploy your FastAPI application to [FastAPI Cloud](https://fastapicloud.com). * This includes `fastapi-cloud-cli`, which allows you to deploy your FastAPI application to [FastAPI Cloud](https://fastapicloud.com).

2
docs/en/docs/advanced/events.md

@ -154,7 +154,7 @@ Underneath, in the ASGI technical specification, this is part of the [Lifespan P
/// note /// note
You can read more about the Starlette `lifespan` handlers in [Starlette's Lifespan' docs](https://www.starlette.dev/lifespan/). You can read more about the Starlette `lifespan` handlers in [Starlette's Lifespan' docs](https://starlette.dev/lifespan/).
Including how to handle lifespan state that can be used in other areas of your code. Including how to handle lifespan state that can be used in other areas of your code.

2
docs/en/docs/advanced/middleware.md

@ -94,4 +94,4 @@ For example:
* [Uvicorn's `ProxyHeadersMiddleware`](https://github.com/encode/uvicorn/blob/master/uvicorn/middleware/proxy_headers.py) * [Uvicorn's `ProxyHeadersMiddleware`](https://github.com/encode/uvicorn/blob/master/uvicorn/middleware/proxy_headers.py)
* [MessagePack](https://github.com/florimondmanca/msgpack-asgi) * [MessagePack](https://github.com/florimondmanca/msgpack-asgi)
To see other available middlewares check [Starlette's Middleware docs](https://www.starlette.dev/middleware/) and the [ASGI Awesome List](https://github.com/florimondmanca/awesome-asgi). To see other available middlewares check [Starlette's Middleware docs](https://starlette.dev/middleware/) and the [ASGI Awesome List](https://github.com/florimondmanca/awesome-asgi).

2
docs/en/docs/advanced/response-cookies.md

@ -48,4 +48,4 @@ And as the `Response` can be used frequently to set headers and cookies, **FastA
/// ///
To see all the available parameters and options, check the [documentation in Starlette](https://www.starlette.dev/responses/#set-cookie). To see all the available parameters and options, check the [documentation in Starlette](https://starlette.dev/responses/#set-cookie).

2
docs/en/docs/advanced/response-headers.md

@ -38,4 +38,4 @@ And as the `Response` can be used frequently to set headers and cookies, **FastA
Keep in mind that custom proprietary headers can be added [using the `X-` prefix](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers). Keep in mind that custom proprietary headers can be added [using the `X-` prefix](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers).
But if you have custom headers that you want a client in a browser to be able to see, you need to add them to your CORS configurations (read more in [CORS (Cross-Origin Resource Sharing)](../tutorial/cors.md)), using the parameter `expose_headers` documented in [Starlette's CORS docs](https://www.starlette.dev/middleware/#corsmiddleware). But if you have custom headers that you want a client in a browser to be able to see, you need to add them to your CORS configurations (read more in [CORS (Cross-Origin Resource Sharing)](../tutorial/cors.md)), using the parameter `expose_headers` documented in [Starlette's CORS docs](https://starlette.dev/middleware/#corsmiddleware).

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

@ -123,4 +123,4 @@ And because you are using `StaticFiles`, that CSS file would be served automatic
## More details { #more-details } ## More details { #more-details }
For more details, including how to test templates, check [Starlette's docs on templates](https://www.starlette.dev/templates/). For more details, including how to test templates, check [Starlette's docs on templates](https://starlette.dev/templates/).

2
docs/en/docs/advanced/testing-events.md

@ -5,7 +5,7 @@ When you need `lifespan` to run in your tests, you can use the `TestClient` with
{* ../../docs_src/app_testing/tutorial004_py310.py hl[9:15,18,27:28,30:32,41:43] *} {* ../../docs_src/app_testing/tutorial004_py310.py hl[9:15,18,27:28,30:32,41:43] *}
You can read more details about the ["Running lifespan in tests in the official Starlette documentation site."](https://www.starlette.dev/lifespan/#running-lifespan-in-tests) You can read more details about the ["Running lifespan in tests in the official Starlette documentation site."](https://starlette.dev/lifespan/#running-lifespan-in-tests)
For the deprecated `startup` and `shutdown` events, you can use the `TestClient` as follows: For the deprecated `startup` and `shutdown` events, you can use the `TestClient` as follows:

2
docs/en/docs/advanced/testing-websockets.md

@ -8,6 +8,6 @@ For this, you use the `TestClient` in a `with` statement, connecting to the WebS
/// note /// note
For more details, check Starlette's documentation for [testing WebSockets](https://www.starlette.dev/testclient/#testing-websocket-sessions). For more details, check Starlette's documentation for [testing WebSockets](https://starlette.dev/testclient/#testing-websocket-sessions).
/// ///

4
docs/en/docs/advanced/using-request-directly.md

@ -15,7 +15,7 @@ But there are situations where you might need to access the `Request` object dir
## Details about the `Request` object { #details-about-the-request-object } ## Details about the `Request` object { #details-about-the-request-object }
As **FastAPI** is actually **Starlette** underneath, with a layer of several tools on top, you can use Starlette's [`Request`](https://www.starlette.dev/requests/) object directly when you need to. As **FastAPI** is actually **Starlette** underneath, with a layer of several tools on top, you can use Starlette's [`Request`](https://starlette.dev/requests/) object directly when you need to.
It would also mean that if you get data from the `Request` object directly (for example, read the body) it won't be validated, converted or documented (with OpenAPI, for the automatic API user interface) by FastAPI. It would also mean that if you get data from the `Request` object directly (for example, read the body) it won't be validated, converted or documented (with OpenAPI, for the automatic API user interface) by FastAPI.
@ -45,7 +45,7 @@ The same way, you can declare any other parameter as normally, and additionally,
## `Request` documentation { #request-documentation } ## `Request` documentation { #request-documentation }
You can read more details about the [`Request` object in the official Starlette documentation site](https://www.starlette.dev/requests/). You can read more details about the [`Request` object in the official Starlette documentation site](https://starlette.dev/requests/).
/// note | Technical Details /// note | Technical Details

4
docs/en/docs/advanced/websockets.md

@ -182,5 +182,5 @@ If you need something easy to integrate with FastAPI but that is more robust, su
To learn more about the options, check Starlette's documentation for: To learn more about the options, check Starlette's documentation for:
* [The `WebSocket` class](https://www.starlette.dev/websockets/). * [The `WebSocket` class](https://starlette.dev/websockets/).
* [Class-based WebSocket handling](https://www.starlette.dev/endpoints/#websocketendpoint). * [Class-based WebSocket handling](https://starlette.dev/endpoints/#websocketendpoint).

4
docs/en/docs/alternatives.md

@ -417,7 +417,7 @@ Handle all the data validation, data serialization and automatic model documenta
/// ///
### [Starlette](https://www.starlette.dev/) { #starlette } ### [Starlette](https://starlette.dev/) { #starlette }
Starlette is a lightweight <dfn title="The new standard for building asynchronous Python web applications">ASGI</dfn> framework/toolkit, which is ideal for building high-performance asyncio services. Starlette is a lightweight <dfn title="The new standard for building asynchronous Python web applications">ASGI</dfn> framework/toolkit, which is ideal for building high-performance asyncio services.
@ -462,7 +462,7 @@ So, anything that you can do with Starlette, you can do it directly with **FastA
/// ///
### [Uvicorn](https://www.uvicorn.dev/) { #uvicorn } ### [Uvicorn](https://uvicorn.dev) { #uvicorn }
Uvicorn is a lightning-fast ASGI server, built on uvloop and httptools. Uvicorn is a lightning-fast ASGI server, built on uvloop and httptools.

2
docs/en/docs/deployment/manually.md

@ -52,7 +52,7 @@ The main thing you need to run a **FastAPI** application (or any other ASGI appl
There are several alternatives, including: There are several alternatives, including:
* [Uvicorn](https://www.uvicorn.dev/): a high performance ASGI server. * [Uvicorn](https://uvicorn.dev): a high performance ASGI server.
* [Hypercorn](https://hypercorn.readthedocs.io/): an ASGI server compatible with HTTP/2 and Trio among other features. * [Hypercorn](https://hypercorn.readthedocs.io/): an ASGI server compatible with HTTP/2 and Trio among other features.
* [Daphne](https://github.com/django/daphne): the ASGI server built for Django Channels. * [Daphne](https://github.com/django/daphne): the ASGI server built for Django Channels.
* [Granian](https://github.com/emmett-framework/granian): A Rust HTTP server for Python applications. * [Granian](https://github.com/emmett-framework/granian): A Rust HTTP server for Python applications.

2
docs/en/docs/fastapi-cli.md

@ -52,7 +52,7 @@ For production you would use `fastapi run` instead of `fastapi dev`. 🚀
/// ///
Internally, **FastAPI CLI** uses [Uvicorn](https://www.uvicorn.dev), a high-performance, production-ready, ASGI server. 😎 Internally, **FastAPI CLI** uses [Uvicorn](https://uvicorn.dev), a high-performance, production-ready, ASGI server. 😎
The `fastapi` CLI will try to detect automatically the FastAPI app to run, assuming it's an object called `app` in a file `main.py` (or a couple other variants). The `fastapi` CLI will try to detect automatically the FastAPI app to run, assuming it's an object called `app` in a file `main.py` (or a couple other variants).

2
docs/en/docs/features.md

@ -159,7 +159,7 @@ Any integration is designed to be so simple to use (with dependencies) that you
## Starlette features { #starlette-features } ## Starlette features { #starlette-features }
**FastAPI** is fully compatible with (and based on) [**Starlette**](https://www.starlette.dev/). So, any additional Starlette code you have, will also work. **FastAPI** is fully compatible with (and based on) [**Starlette**](https://starlette.dev/). So, any additional Starlette code you have, will also work.
`FastAPI` is actually a sub-class of `Starlette`. So, if you already know or use Starlette, most of the functionality will work the same way. `FastAPI` is actually a sub-class of `Starlette`. So, if you already know or use Starlette, most of the functionality will work the same way.

2
docs/en/docs/history-design-future.md

@ -58,7 +58,7 @@ After testing several alternatives, I decided that I was going to use [**Pydanti
Then I contributed to it, to make it fully compliant with JSON Schema, to support different ways to define constraint declarations, and to improve editor support (type checks, autocompletion) based on the tests in several editors. Then I contributed to it, to make it fully compliant with JSON Schema, to support different ways to define constraint declarations, and to improve editor support (type checks, autocompletion) based on the tests in several editors.
During the development, I also contributed to [**Starlette**](https://www.starlette.dev/), the other key requirement. During the development, I also contributed to [**Starlette**](https://starlette.dev/), the other key requirement.
## Development { #development } ## Development { #development }

2
docs/en/docs/how-to/custom-request-and-route.md

@ -66,7 +66,7 @@ The `scope` `dict` and `receive` function are both part of the ASGI specificatio
And those two things, `scope` and `receive`, are what is needed to create a new `Request` instance. And those two things, `scope` and `receive`, are what is needed to create a new `Request` instance.
To learn more about the `Request` check [Starlette's docs about Requests](https://www.starlette.dev/requests/). To learn more about the `Request` check [Starlette's docs about Requests](https://starlette.dev/requests/).
/// ///

6
docs/en/docs/index.md

@ -175,7 +175,7 @@ If you are building a <abbr title="Command Line Interface">CLI</abbr> app to be
FastAPI stands on the shoulders of giants: FastAPI stands on the shoulders of giants:
* [Starlette](https://www.starlette.dev/) for the web parts. * [Starlette](https://starlette.dev/) for the web parts.
* [Pydantic](https://docs.pydantic.dev/) for the data parts. * [Pydantic](https://docs.pydantic.dev/) for the data parts.
## Installation { #installation } ## Installation { #installation }
@ -277,7 +277,7 @@ INFO: Application startup complete.
<details markdown="1"> <details markdown="1">
<summary>About the command <code>fastapi dev</code>...</summary> <summary>About the command <code>fastapi dev</code>...</summary>
The command `fastapi dev` reads your `main.py` file automatically, detects the **FastAPI** app in it, and starts a server using [Uvicorn](https://www.uvicorn.dev). The command `fastapi dev` reads your `main.py` file automatically, detects the **FastAPI** app in it, and starts a server using [Uvicorn](https://uvicorn.dev).
By default, `fastapi dev` will start with auto-reload enabled for local development. By default, `fastapi dev` will start with auto-reload enabled for local development.
@ -554,7 +554,7 @@ Used by Starlette:
Used by FastAPI: Used by FastAPI:
* [`uvicorn`](https://www.uvicorn.dev) - for the server that loads and serves your application. This includes `uvicorn[standard]`, which includes some dependencies (e.g. `uvloop`) needed for high performance serving. * [`uvicorn`](https://uvicorn.dev) - for the server that loads and serves your application. This includes `uvicorn[standard]`, which includes some dependencies (e.g. `uvloop`) needed for high performance serving.
* `fastapi-cli[standard]` - to provide the `fastapi` command. * `fastapi-cli[standard]` - to provide the `fastapi` command.
* This includes `fastapi-cloud-cli`, which allows you to deploy your FastAPI application to [FastAPI Cloud](https://fastapicloud.com). * This includes `fastapi-cloud-cli`, which allows you to deploy your FastAPI application to [FastAPI Cloud](https://fastapicloud.com).

2
docs/en/docs/release-notes.md

@ -6854,7 +6854,7 @@ Note: all the previous parameters are still there, so it's still possible to dec
* Upgrade the compatible version of Starlette to `0.12.0`. * Upgrade the compatible version of Starlette to `0.12.0`.
* This includes support for ASGI 3 (the latest version of the standard). * This includes support for ASGI 3 (the latest version of the standard).
* It's now possible to use [Starlette's `StreamingResponse`](https://www.starlette.dev/responses/#streamingresponse) with iterators, like [file-like](https://docs.python.org/3/glossary.html#term-file-like-object) objects (as those returned by `open()`). * It's now possible to use [Starlette's `StreamingResponse`](https://starlette.dev/responses/#streamingresponse) with iterators, like [file-like](https://docs.python.org/3/glossary.html#term-file-like-object) objects (as those returned by `open()`).
* It's now possible to use the low level utility `iterate_in_threadpool` from `starlette.concurrency` (for advanced scenarios). * It's now possible to use the low level utility `iterate_in_threadpool` from `starlette.concurrency` (for advanced scenarios).
* PR [#243](https://github.com/tiangolo/fastapi/pull/243). * PR [#243](https://github.com/tiangolo/fastapi/pull/243).

4
docs/en/docs/tutorial/background-tasks.md

@ -63,7 +63,7 @@ And then another background task generated at the *path operation function* will
## Technical Details { #technical-details } ## Technical Details { #technical-details }
The class `BackgroundTasks` comes directly from [`starlette.background`](https://www.starlette.dev/background/). The class `BackgroundTasks` comes directly from [`starlette.background`](https://starlette.dev/background/).
It is imported/included directly into FastAPI so that you can import it from `fastapi` and avoid accidentally importing the alternative `BackgroundTask` (without the `s` at the end) from `starlette.background`. It is imported/included directly into FastAPI so that you can import it from `fastapi` and avoid accidentally importing the alternative `BackgroundTask` (without the `s` at the end) from `starlette.background`.
@ -71,7 +71,7 @@ By only using `BackgroundTasks` (and not `BackgroundTask`), it's then possible t
It's still possible to use `BackgroundTask` alone in FastAPI, but you have to create the object in your code and return a Starlette `Response` including it. It's still possible to use `BackgroundTask` alone in FastAPI, but you have to create the object in your code and return a Starlette `Response` including it.
You can see more details in [Starlette's official docs for Background Tasks](https://www.starlette.dev/background/). You can see more details in [Starlette's official docs for Background Tasks](https://starlette.dev/background/).
## Caveat { #caveat } ## Caveat { #caveat }

2
docs/en/docs/tutorial/first-steps.md

@ -232,7 +232,7 @@ That's it! Now you can access your app at that URL. ✨
`FastAPI` is a class that inherits directly from `Starlette`. `FastAPI` is a class that inherits directly from `Starlette`.
You can use all the [Starlette](https://www.starlette.dev/) functionality with `FastAPI` too. You can use all the [Starlette](https://starlette.dev/) functionality with `FastAPI` too.
/// ///

2
docs/en/docs/tutorial/handling-errors.md

@ -81,7 +81,7 @@ But in case you needed it for an advanced scenario, you can add custom headers:
## Install custom exception handlers { #install-custom-exception-handlers } ## Install custom exception handlers { #install-custom-exception-handlers }
You can add custom exception handlers with [the same exception utilities from Starlette](https://www.starlette.dev/exceptions/). You can add custom exception handlers with [the same exception utilities from Starlette](https://starlette.dev/exceptions/).
Let's say you have a custom exception `UnicornException` that you (or a library you use) might `raise`. Let's say you have a custom exception `UnicornException` that you (or a library you use) might `raise`.

2
docs/en/docs/tutorial/middleware.md

@ -37,7 +37,7 @@ The middleware function receives:
Keep in mind that custom proprietary headers can be added [using the `X-` prefix](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers). Keep in mind that custom proprietary headers can be added [using the `X-` prefix](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers).
But if you have custom headers that you want a client in a browser to be able to see, you need to add them to your CORS configurations ([CORS (Cross-Origin Resource Sharing)](cors.md)) using the parameter `expose_headers` documented in [Starlette's CORS docs](https://www.starlette.dev/middleware/#corsmiddleware). But if you have custom headers that you want a client in a browser to be able to see, you need to add them to your CORS configurations ([CORS (Cross-Origin Resource Sharing)](cors.md)) using the parameter `expose_headers` documented in [Starlette's CORS docs](https://starlette.dev/middleware/#corsmiddleware).
/// ///

2
docs/en/docs/tutorial/static-files.md

@ -45,4 +45,4 @@ All these parameters can be different than "`static`", adjust them to the needs
## More info { #more-info } ## More info { #more-info }
For more details and options check [Starlette's docs about Static Files](https://www.starlette.dev/staticfiles/). For more details and options check [Starlette's docs about Static Files](https://starlette.dev/staticfiles/).

2
docs/en/docs/tutorial/testing.md

@ -1,6 +1,6 @@
# Testing { #testing } # Testing { #testing }
Thanks to [Starlette](https://www.starlette.dev/testclient/), testing **FastAPI** applications is easy and enjoyable. Thanks to [Starlette](https://starlette.dev/testclient/), testing **FastAPI** applications is easy and enjoyable.
It is based on [HTTPX](https://www.python-httpx.org), which in turn is designed based on Requests, so it's very familiar and intuitive. It is based on [HTTPX](https://www.python-httpx.org), which in turn is designed based on Requests, so it's very familiar and intuitive.

4
fastapi/applications.py

@ -66,7 +66,7 @@ class FastAPI(Starlette):
errors. errors.
Read more in the Read more in the
[Starlette docs for Applications](https://www.starlette.dev/applications/#starlette.applications.Starlette). [Starlette docs for Applications](https://starlette.dev/applications/#starlette.applications.Starlette).
""" """
), ),
] = False, ] = False,
@ -960,7 +960,7 @@ class FastAPI(Starlette):
This is simply inherited from Starlette. This is simply inherited from Starlette.
Read more about it in the Read more about it in the
[Starlette docs for Applications](https://www.starlette.dev/applications/#storing-state-on-the-app-instance). [Starlette docs for Applications](https://starlette.dev/applications/#storing-state-on-the-app-instance).
""" """
), ),
] = State() ] = State()

Loading…
Cancel
Save