This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

more.chameleon: Chameleon template integration for Morepath

more.chameleon is an extension for Morepath that adds Zope Page Template (ZPT) support for the .pt extension, using the Chameleon template engine.

For details on the ZPT template language see the Chameleon language reference.

Example usage:

from more.chameleon import ChameleonApp

class App(ChameleonApp):
    pass

@App.path(path='persons/{name}')
class Person(object):
     def __init__(self, name):
         self.name = name

@App.template_directory()
def get_template_directory():
    return 'templates'

@App.html(model=Person, template='person.pt')
def person_default(self, request):
    return {'name': self.name}

and then in person.pt (in the templates subdirectory):

<html>
<body>
<p>Hello ${name}!</p>
</body>
</html>

During development it can be helpful to have Chameleon reload templates automatically after a change. To enable this feature use the MOREPATH_TEMPLATE_AUTO_RELOAD environment variable.

You can enable it for your process:

MOREPATH_TEMPLATE_AUTO_RELOAD=1 python run.py

Or for your shell:

export MOREPATH_TEMPLATE_AUTO_RELOAD=1
python run.py

To further control Chameleon rendering you can define a chameleon setting section in your app. For instance, here is how you turn on Chameleon’s debug functionality:

@App.setting_section(section='chameleon')
def get_setting_section():
    return {'debug': True}

For details on Chameleon configuration options, consult the configuration keyword arguments in the Chameleon API reference.

CHANGES

0.2 (2016-01-23)

0.1 (2015-04-09)

  • Initial public release.
Release History

Release History

0.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
more.chameleon-0.2-py2.py3-none-any.whl (8.5 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Jan 23, 2016
more.chameleon-0.2.tar.gz (7.4 kB) Copy SHA256 Checksum SHA256 Source Jan 23, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting