Skip to main content

Validators library support for cherrypy.

Project description

validators library support for cherrypy.

Installation

pip install marbaloo_validators

Usage

# app.py
import cherrypy
import marbaloo_validators
import os

marbaloo_validators.Plugin(cherrypy.engine).subscribe()
cherrypy.tools.validators = marbaloo_validators.Tool()


class Root(object):

    @cherrypy.expose
    def index(self):
        validators = cherrypy.request.validators
        if validators.email('example@site.com'):
            return 'TRUE'
        else:
            return 'FALSE'

root_path = os.path.dirname(__file__)
config = {
    '/': {
        'tools.validators.on': True
    }
}
cherrypy.quickstart(Root(), '/', config)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

marbaloo_validators-0.1.1.tar.gz (2.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page