python - The best way to validate form-data in tornado project? -


i need validate data in tornado project (pure-tornado including static pages, no django application)

there 2 situations: 1) validate json-object obtained http-api or ws 2) validate data page form transmitted in http request (requeshandler)

what do? use django forms? or maybe else, best suited situation? say?

i suggest wtforms handing form submissions, there numerous posts how go example on google group here , stackoverflow answer here. wtforms requires request data in specific information , above links state , give examples on how achieve format.

but, part of question looks wanting check json input api requests. recommend schema. schema library provides method validate input such dict or in case json input. raise , error if data not conform rules.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -