register_static
Register a static file to be served by the Pages system and return its URL path. The URL already carries a signed ?token= query parameter, valid for 24 hours, and every call returns a fresh one, so no manual cache busting is needed. To add query parameters, append them with &: a second ? corrupts the token and the file fails to load once published. Raises FileNotFoundError if the file does not exist, or ValueError if it is outside the project root.
Parameters
| Name | Description | Type | Default |
|---|---|---|---|
| file_path (required) | Path to the static file to register. | str | os.PathLike |
Return Value
"str"