pub trait StaticFilesProvider {
// Provided methods
fn static_dir(&self) -> Option<PathBuf> { ... }
fn static_url_prefix(&self) -> Option<String> { ... }
}Available on crate feature
core and non-WebAssembly only.Expand description
Trait for providing static file directories
Applications can implement this trait to provide static files that will be automatically discovered by collectstatic.
Provided Methods§
Sourcefn static_dir(&self) -> Option<PathBuf>
fn static_dir(&self) -> Option<PathBuf>
Get the static files directory for this app
Returns None if the app does not provide static files
Sourcefn static_url_prefix(&self) -> Option<String>
fn static_url_prefix(&self) -> Option<String>
Get the static URL prefix for this app
Default: “/static/{app_label}/”
Implementors§
impl StaticFilesProvider for AppConfig
Default implementations for AppConfig