sanic.pages.base.BasePage#

Base page for Sanic pages.

Inherits from: ABC

class BasePage(debug: <class 'bool'> = True): -> None

render#

Renders the page.

def render(self): -> <class 'str'>

Return
str

The rendered page.

style#

Returns the CSS for the page.

@property
def style(self): -> <class 'str'>

Return
str

The CSS for the page.

sanic.pages.css.CSS#

Cascade stylesheets, i.e. combine all ancestor styles

Inherits from: ABCMeta

class CSS(name, bases, attrs)

register#

Register a virtual subclass of an ABC.

def register(cls, subclass)

Returns the subclass, to allow usage as a class decorator.

sanic.pages.directory_page.DirectoryPage#

Page for viewing a directory.

Inherits from: BasePage, ABC

class DirectoryPage(files: typing.Iterable[sanic.pages.directory_page.FileInfo], url: <class 'str'>, debug: <class 'bool'>): -> None

render#

Renders the page.

def render(self): -> <class 'str'>

Return
str

The rendered page.

style#

Returns the CSS for the page.

@property
def style(self): -> <class 'str'>

Return
str

The CSS for the page.

sanic.pages.directory_page.FileInfo#

Type for file info.

Inherits from: dict

class FileInfo(self)

sanic.pages.error.ErrorPage#

Page for displaying an error.

Inherits from: BasePage, ABC

class ErrorPage(debug: <class 'bool'>, title: <class 'str'>, text: <class 'str'>, request: <class 'sanic.request.types.Request'>, exc: <class 'Exception'>): -> None

render#

Renders the page.

def render(self): -> <class 'str'>

Return
str

The rendered page.

style#

Returns the CSS for the page.

@property
def style(self): -> <class 'str'>

Return
str

The CSS for the page.