Skip to main content

StaticFilesProvider

Trait StaticFilesProvider 

Source
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§

Source

fn static_dir(&self) -> Option<PathBuf>

Get the static files directory for this app

Returns None if the app does not provide static files

Source

fn static_url_prefix(&self) -> Option<String>

Get the static URL prefix for this app

Default: “/static/{app_label}/”

Implementors§

Source§

impl StaticFilesProvider for AppConfig

Default implementations for AppConfig