Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
ROSEdu Tech Talks Prezentarea 04: WSGI

ROSEdu Tech Talks Prezentarea 04: WSGI

Ratings: (0)|Views: 17|Likes:
Published by ROSEdu
http://talks.rosedu.org
http://talks.rosedu.org

More info:

Categories:Types, Research
Published by: ROSEdu on Oct 18, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

10/18/2010

pdf

text

original

 
123456 __ _______ _____ _____ 7\ \ / / ____|/ ____|_ _|8\ \ /\ / / (___ | | __ | |9\ \/ \/ / \___ \| | |_ | | |10\ /\ / ____) | |__| |_| |_ 11\/ \/ |_____/ \_____|_____|12131415
# Python Web Server Gateway Interface #
161718192021[Alex Morega] (http://grep.ro) 2223--------------------------------------------------------24ROSEdu TechTalks, 2009/11/10
 
12
### Ce este WSGI? ###
34*Ce
*nu*
este:5- web framework6+Django, Pylons, TurboGears, Zope, repoze.bfg7- web server8+`wsgiref.simpleserver`,`mod_wsgi`, 9flup/Paste, CherryPy1011*Ce este:12+ API pentru HTTP în Python13+conven
ț
ii preluate din CGI14+ minimalist1516* Aplica
ț
ie "hello world":1718def hello_app(environ, start_response):19start_response('200 OK', [('Content-Type',20'text/plain')])21return ['Hello WWW!']2223--------------------------------------------------------24ROSEdu TechTalks, 2009/11/10
 
12
### Cum func
ț
ioneaz
ă
###
345*`environ`: 6+toat
ă
informa
ț
ia despre request7-variabile CGI8+informa
ț
ie de la alte layere (middleware)9-chei cu litere mici, namespaced101112*`start_response`: 13+înseamn
ă
"sunt gata s
ă
trimit r
ă
spunsul"14+status code, response headers151617*`return`: 18+iterator cu response body (ex. o list
ă
)19+trimite r
ă
spunsul în buc
ăț
i20212223--------------------------------------------------------24ROSEdu TechTalks, 2009/11/10

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->