Open source cms for mobile and desktop websites

Design plugin example: Python configuration

python configuration example for a website design including main template and static directory

Scaffold download:

The module has to be in the current python path to be added to your website.

website.modules.append("nive_tmpl_design_python")

__init__.py

The modules __init__.py defines everything needed to set up the design.

from nive.definitions import ViewModuleConf

configuration = ViewModuleConf("nive_cms.design.view",
    static="nive_tmpl_design_python:static",
    staticName="tmpldesign",
    templates="nive_tmpl_design_python:templates"
)

Templates

Files included in the template directory replace the default templates by name. The example inclueds the main website layout template index.pt.

Static files

The configuration includes static as static directory and maps it to tmpldesign url.

© 2013 Nive GmbH