betty.project.url module¶
URL generators for project resources.
- final class betty.project.url.LocalizedUrlGenerator[source]¶
Bases:
LocalizedUrlGenerator
,ProjectDependentFactory
Generate URLs for all resources provided by a Betty project.
- __init__(*upstreams: LocalizedUrlGenerator)[source]¶
This is private. It MUST NOT be used anywhere outside its containing scope.
- static __new__(*args, **kwargs)¶
- generate(resource: Any, media_type: MediaType, *, absolute: bool = False, locale: Localey | None = None) str [source]¶
Generate a URL for a resource.
- Raises:
- final class betty.project.url.StaticUrlGenerator[source]¶
Bases:
_ProjectUrlGenerator
,StaticUrlGenerator
Generate URLs for static (non-localized) file paths.
- static __new__(*args, **kwargs)¶
- async betty.project.url.new_project_url_generator(project: Project) UrlGenerator [source]¶
Generate URLs for all resources provided by a Betty project.