If you are looking for salesforce consulting services thenContact here
WSGI - Web Server Gateway Interface.
WSGI is specified in PEP 3333. The main goal of WSGI is to facilitate easy interconnection of servers and web frameworks/applications. WSGI defines a standerd API for web servers(ex: uWSGI, Twisted, Gunicorn) to connect and talk to web frameworks like Django, flask, pyramid. Server and framework which followed WSGI specs then it enables the use of any framework with any server for example you can use uWSGi, Gunicorn or Twisted with django with little configuraton.
Hello World! programm using WSGI interface:
from wsgiref.simple_server import make_server def helloworld_app(environ, start_response): """Simple web application which return Hello World to browser""" status = '200 OK' response_headers = [('Content-type', 'text/plain')] start_response(status, response_headers) return [b"Hello World !"] if __name__ == '__main__': # start the serveer server = make_server('', 5000, helloworld_app) server.serve_forever()
Now open the
http://localhost:5000 you can see "Hello World !" text in the browser.
The application object must accept two arguments environ and start_response.
environ: The environ parameter is a dictionary object which contains wsgi and other environment variables. some of usefull environ variables or REQUEST_METHOD(The HTTP request method, such as "GET" or "POST"), QUERY_STRING (URL after the "?") etc.
start_response: The start_response parameter is a callable accepting two required positional arguments( status , response_headers). statu is used to specify http status 200, 302, 404, 500 etc. response_headers are used to specify content-type, Cookie, Authorization.
Response: HTTP deals with bytes so we have to return list of byte strings (ex: b"Hello World !").
In above example i have used default WSGI implimentaion of server(make_server) to run helloworld_app.
Micropyramid is a software development and cloud consulting partner for enterprise businesses across the world. We work on python, Django, Salesforce, Angular, Reactjs, React Native, MySQL, PostgreSQL, Docker, Linux, Ansible, git, amazon web services. We are Amazon and salesforce consulting partner with 5 years of cloud architect experience. We develop e-commerce, retail, banking, machine learning, CMS, CRM web and mobile applications.
Django-CRM :Customer relationship management based on Django
Django-blog-it : django blog with complete customization and ready to use with one click installer Edit
Django-webpacker : A django compressor tool
Django-MFA : Multi Factor Authentication
Docker-box : Web Interface to manage full blown docker containers and imagesMore...