Content deleted Content added
m WP:CHECKWIKI error fixes using AWB (12095) |
|||
Line 35:
==Example of calling an application==
{{Expand section|date=March 2011}}
An example of calling an application and retrieving its response.<ref>[https://www.youtube.com/watch?v=afnDANxsaYo Creating WSGI Middleware]</ref> A web server gives a callback start_response to a web framework application. start_response has a [[Hypertext Transfer Protocol#Response message|http protocol]] status, headers and body. For Django, a [https://docs.djangoproject.com/en/1.10/ref/request-response/#httpresponse-objects HttpResponse] object returned;<ref>[https://github.com/django/django/blob/master/django/http/response.py#L287 Django Response object code on github]</ref> environ has [https://docs.djangoproject.com/en/1.10/topics/settings/ settings.py] initialisations.
<source lang="python">
def call_application(app, environ):
|