smisk.mvc.template — View in MVC

Templating.

requires:mako

New in version 1.1.

Configuration parameters

smisk.mvc.template.autoreload

Automatically reload templates which has been modified.

If this is set to None when the application start accepting requests, the application will set the value according to its own autoreload value.

Default:False
Type:bool
smisk.mvc.template.cache_limit

Limit cache size. 0 means no cache. -1 means no limit. Any positive value results in a LRU-approach.

Default:-1
Type:int
smisk.mvc.template.cache_type

Type of cache. “memory” or “string”.

Default:"memory"
Type:string
smisk.mvc.template.format_exceptions

Let the templating engine render information about template formatting exceptions.

Things like missing or misspelled variables etc.

Default:True
Type:bool
smisk.mvc.template.input_encoding
Default:"utf-8"
Type:string
smisk.mvc.template.default_filters
Default:["unicode"]
Type:list
smisk.mvc.template.errors

Map http error to a template path. Template URI mapped by status codes.

i.e.:

'smisk.mvc.template.errors': {
  500: 'errors/server_error',
  404: 'errors/not_found'
}
Default:{}
Type:dict

Classes

class smisk.mvc.template.Templates

Templates.

adjust_uri(uri, relativeto)
adjust the given uri based on the calling filename.
filename_to_uri(filename)
put_string(uri, text)
put_template(uri, template)
render_error(status, params={}, format='html')
reset_cache()
template_for_uri(uri, exc_if_not_found=True)
Returns:template for the uri provided
Return type:Template