ramka.static package#
Submodules#
ramka.static.engine module#
- class ramka.static.engine.BaseStaticFilesEngine(app, root_dir: Optional[str] = None, prefix: Optional[str] = 'static/', **kwargs)#
Bases:
ABCThe base static files engine class.
The static files engine is responsible for loading static files and rendering them.
This class can be subclassed to implement a custom engine.
- abstract has_file(file_name: str) bool#
Check if the engine has a static file with the given name.
- Parameters:
file_name (str) – The name of the static file to check.
- Returns:
- True if the engine has a static file with the given name,
False otherwise.
- Return type:
bool
- class ramka.static.engine.WhiteNoiseEngine(app, root_dir: Optional[str] = None, prefix: Optional[str] = 'static/', **kwargs)#
Bases:
BaseStaticFilesEngineThe WhiteNoise static files engine class.
The static files engine is responsible for loading static files and rendering them. This engine uses WhiteNoise library to load, and render static files.
- has_file(file_name: str) bool#
Check if the engine has a static file with the given name.
- Parameters:
file_name (str) – The name of the static file to check.
- Returns:
- True if the engine has a static file with the given name,
False otherwise.
- Return type:
bool
Module contents#
- class ramka.static.BaseStaticFilesEngine(app, root_dir: Optional[str] = None, prefix: Optional[str] = 'static/', **kwargs)#
Bases:
ABCThe base static files engine class.
The static files engine is responsible for loading static files and rendering them.
This class can be subclassed to implement a custom engine.
- abstract has_file(file_name: str) bool#
Check if the engine has a static file with the given name.
- Parameters:
file_name (str) – The name of the static file to check.
- Returns:
- True if the engine has a static file with the given name,
False otherwise.
- Return type:
bool
- class ramka.static.WhiteNoiseEngine(app, root_dir: Optional[str] = None, prefix: Optional[str] = 'static/', **kwargs)#
Bases:
BaseStaticFilesEngineThe WhiteNoise static files engine class.
The static files engine is responsible for loading static files and rendering them. This engine uses WhiteNoise library to load, and render static files.
- has_file(file_name: str) bool#
Check if the engine has a static file with the given name.
- Parameters:
file_name (str) – The name of the static file to check.
- Returns:
- True if the engine has a static file with the given name,
False otherwise.
- Return type:
bool