Browse Source

Fix indentation for note block

pull/10742/head
Pamela Fox 1 year ago
committed by GitHub
parent
commit
4e92266c2d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      docs/en/docs/advanced/templates.md

14
docs/en/docs/advanced/templates.md

@ -73,15 +73,15 @@ In this example, it would link to a CSS file at `static/styles.css` with:
And because you are using `StaticFiles`, that CSS file would be served automatically by your **FastAPI** application at the URL `/static/styles.css`. And because you are using `StaticFiles`, that CSS file would be served automatically by your **FastAPI** application at the URL `/static/styles.css`.
!!! note !!! note
The url generated by `url_for` is a full absolute URL, including the protocol. That may not work in a reverse proxy situation, like Traefik or GitHub Codespaces. The url generated by `url_for` is a full absolute URL, including the protocol. That may not work in a reverse proxy situation, like Traefik or GitHub Codespaces.
If you would instead like it to generate relative URLs, you can override the `url_for` template function in your Python code: If you would instead like it to generate relative URLs, you can override the `url_for` template function in your Python code:
```python ```python
templates.env.globals["url_for"] = app.url_path_for templates.env.globals["url_for"] = app.url_path_for
``` ```
Another way to affect the generated URLs is to customize `uvicorn` with arguments like `proxy-headers`, `root-path`, and `forwarded-allow-ips`. Another way to affect the generated URLs is to customize `uvicorn` with arguments like `proxy-headers`, `root-path`, and `forwarded-allow-ips`.
See <a href="https://www.uvicorn.org/settings/#http">uvicorn's docs on settings</a>. See <a href="https://www.uvicorn.org/settings/#http">uvicorn's docs on settings</a>.
## More details ## More details

Loading…
Cancel
Save