WebDispatch

Screenshot Software:
WebDispatch
Detalii soft:
Versiune: 1.0 Beta 4
Incarca data: 20 Feb 15
Producător: Atsushi Odagiri
Licenţă: Gratuit
Popularitate: 0

Rating: nan/5 (Total Votes: 0)

WebDispatch este colectia de dispecer pentru aplicarea WSGI & nbsp;. Asta nu are nici o dependență de cadre exsiting, dar funcționează bine cu WebOb.
Dispecerat și generare URL
expediem cu modele pentru adresele URL.
exemplu de aplicare Helo:
>>> Din wsgify import webob.dec
>>>wsgify
... Salut def (cerere):
... De returnare "Bună ziua,% s",% request.urlvars ['name']
crea și configura URL Expeditor:
>>> Din webdispatch URLDispatcher import
>>> Dispecer = URLDispatcher ()
>>> Dispatcher.add_url ("de sus", "/ Bună ziua / {name}", salut)
invoca dispecer ca Aplicație WSGI:
>>> Din webob Cerere import
>>> Cer = Request.blank ('/ Bună ziua / webdispatch ")
>>> Res = req.get_response (dispecer)
>>> Res.body
"Bună ziua, webdispatch"
Acțiune Dispecerat
ActionDispatcher invocă metoda obiect cu numele acțiune de la urlvars.
acțiune de clasă handler:
>>> MyHandler clasă (obiect):
...wsgify
... Salut def (auto, cerere):
... Întoarcere "Hello"
crea și configura ActionDispatcher:
>>> Din webdispatch ActionDispatcher import
>>> Actiondispatcher = ActionDispatcher ()
>>> Actiondispatcher.register_actionhandler (MyHandler)
adauga acțiune url cu acțiune urlvars nume:
>>> Dispatcher.add_url ("action_dispatch", "/ acțiuni / {} acțiune", actiondispatcher)
invoca appclication WSGI .:
>>> Cer = Request.blank ('/ acțiuni / salut ")
>>> Res = req.get_response (dispecer)
>>> Res.body
'Alo'
Metoda de expediere
expediere prin metoda HTTP liniștitor.
eșantion app WSGI:
>>>wsgify
... Get_hello def (cerere):
... Întoarce "Get Hello"
>>>wsgify
... Post_hello def (cerere):
... Întoarcere "Publica Hello"
crearea și configurarea:
>>> Din webdispatch MethodDispatcher import
>>> Restapp = MethodDispatcher ()
>>> Restapp.register_app ("primi", get_hello)
>>> Restapp.register_app ("post", post_hello)
Fiecare cererile sunt înregistrate cu numele HTTP metoda.
invoca aplicare WSGI:
>>> Cer = Request.blank ('/')
>>> Res = req.get_response (restapp)
>>> Res.body
"Ia Hello"

Ce este nou în această versiune:

  • corp răspuns Fix la bytes

Ce este nou în versiunea 1.0 Beta 2:

  • bug configurare Fix

Cerințe :

  • Python

Alte software-uri de dezvoltator Atsushi Odagiri

noseonalchemist
noseonalchemist

15 Apr 15

rebecca.fanstatic
rebecca.fanstatic

14 Apr 15

jsonrpc2
jsonrpc2

12 May 15

Comentarii la WebDispatch

Comentariile nu a fost găsit
Adauga comentarii
Porniţi pe imagini!