WebDispatch

Software screenshot:
WebDispatch
Dettagli del software:
Versione: 1.0 Beta 4
Data di caricamento: 20 Feb 15
Sviluppatore: Atsushi Odagiri
Licenza: Libero
Popolarità: 0

Rating: nan/5 (Total Votes: 0)

WebDispatch è raccolta dispatcher per applicazioni WSGI. & Nbsp; che non ha dipendenza quadri exsiting, ma funziona bene con WebOb.
Spedizione e Genera URL
spedizione con modelli di URL.
esempio di applicazione helo:
>>> Da webob.dec wsgify import
>>>wsgify
... Def saluto (richiesta):
... Ritorno "Ciao,% s"% request.urlvars ['name']
creare e configurare URL Dispatcher:
>>> Da webdispatch import URLDispatcher
>>> Dispatcher = URLDispatcher ()
>>> Dispatcher.add_url ('top', '/ ciao / {nome}', auguri)
invocare dispatcher come WSGI Applicazione:
>>> Da webob import Request
>>> Req = Request.blank ('/ ciao / webdispatch')
>>> Res = req.get_response (dispatcher)
>>> Res.body
'Ciao, webdispatch'
Azione spedizione
ActionDispatcher richiama il metodo oggetto con nome di azione da urlvars.
class action handler:
>>> MyHandler classe (oggetto):
...wsgify
... Def saluto (auto, richiesta):
... Ritorno "Ciao"
creare e configurare ActionDispatcher:
>>> Da webdispatch import ActionDispatcher
>>> Actiondispatcher = ActionDispatcher ()
>>> Actiondispatcher.register_actionhandler (MyHandler)
aggiungere azione url con urlvars nome azione:
>>> Dispatcher.add_url ('action_dispatch', '/ azioni / {action}', actiondispatcher)
invocare appclication WSGI .:
>>> Req = Request.blank ('/ azioni / greeting')
>>> Res = req.get_response (dispatcher)
>>> Res.body
'Ciao A Te'
Metodo spedizione
partenza dal metodo HTTP restfully.
campione app WSGI:
>>>wsgify
... Def get_hello (richiesta):
... Ritorno "Get Ciao"
>>>wsgify
... Def post_hello (richiesta):
... Ritorno "Post Ciao"
creare e configurare:
>>> Da webdispatch import MethodDispatcher
>>> Restapp = MethodDispatcher ()
>>> Restapp.register_app ('get', get_hello)
>>> Restapp.register_app ('post', post_hello)
Ogni applicazioni sono registrati con il nome metodo HTTP.
richiamare applicazione WSGI:
>>> Req = Request.blank ('/')
>>> Res = req.get_response (restapp)
>>> Res.body
'Get Ciao'

Cosa c'è di nuovo in questa versione:

  • Fix corpo risposta bytes

Cosa c'è di nuovo in versione 1.0 Beta 2:

  • Impostazione Fix bug

Requisiti :

  • Python

Altri software di sviluppo Atsushi Odagiri

aodag.scaffold
aodag.scaffold

11 May 15

jsonrpc2
jsonrpc2

12 May 15

rebecca.fanstatic
rebecca.fanstatic

14 Apr 15

Commenti a WebDispatch

I commenti non trovato
Aggiungi commento
Accendere le immagini!