![]() |
WSGI server vs Web Server - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html) +--- Thread: WSGI server vs Web Server (/thread-17793.html) |
RE: WSGI server vs Web Server - Skaperen - May-27-2019 i reference CGI to show that it is not a good choice. i've known this for 2-3 decades. i even wrote an HTTP server that turned request paths into library loads (instead of exec) in C. it benched about 27 times faster than CGI in Apache, probably because it held on to libraries between requests and many different requests used the same library. i'm very much wanting to see what WSGI is about. i thought it might be about the Python interface, but there being a Ruby version, that is ruled out. to the google to research this. RE: WSGI server vs Web Server - heiner55 - May-27-2019 I know CGI is bad, but if users want to have it. RE: WSGI server vs Web Server - Skaperen - May-27-2019 if users want to have it in Python then let them run deprecated code or do it the old way. RE: WSGI server vs Web Server - heiner55 - May-27-2019 Exactly. RE: WSGI server vs Web Server - snippsat - May-27-2019 (May-27-2019, 07:39 AM)Skaperen Wrote: i'm very much wanting to see what WSGI is about. i thought it might be about the Python interface, but there being a Ruby version, that is ruled out. to the google to research this.It's is all about the Python interface,there are good project like Gunicorn and uWSGI(eg Instagram use it). Gunicorn is all Python,so what if it has gotten get inspiration from a similar Ruby project. This is how Digital Ocean and Heroku good Python host describe Gunicorn: Quote:Gunicorn is a pure-Python HTTP server for WSGI applications. All Python web-framework(Flask, Django...ect) is today build on top of WSGI. Flask Quote:100% WSGI 1.0 compliant Skaperen Wrote:if users want to have it in Python then let them run deprecated code or do it the old way.I agree with this,but i gone share my advice of what i think is the best choice for new user staring web-development in Python. Like 95 percent of my time doing web-development none of this WSGI server stuff matter. I use the Build development server for all project in Flask,then can focus on learning HTML/CSS/Javascipt without thinking of server stuff before i have to. RE: WSGI server vs Web Server - Skaperen - May-27-2019 so there are no HTTP (re)definitions in WSGI and the proxies don't need to make any changes other than port number. a WSGI server is basically a persistent thing that calls Python code instead of exec processes as determined by the HTTP request and any appropriate configurations and/or registrations ... it's a HTTP to API interfacer. if i got that right, then i still need to learn it, eventually, to do web development (as opposed to using an existing framework). RE: WSGI server vs Web Server - snippsat - May-27-2019 (May-27-2019, 06:36 PM)Skaperen Wrote: s a HTTP to API interfacer. if i got that right,Look at Full Stack Python WSGI Servers for more info. Quote:then i still need to learn it, eventually, to do web development (as opposed to using an existing framework).Using WSGI directly for web-development is not a pleasant thing,people who want to create yet another Python web-framework most read the WSGI specification. There is no need at all for user that want to do web-development in Python,to read the WSGI doc. Look at Werkzeug it's a thinner layer over WSGI. Quote:Werkzeug is a comprehensive WSGI web application library. From Werkzeug came Flask same Author Armin Ronacher now under Pallets Projects with more developer that keep stuff updated. With Flask work close to HTML/CSS/JavaScript with very little over head,it's very pleasant to do web-development in. Django is also good,but it's has an other model that Flask with a lot stuff build in even if need it or not. RE: WSGI server vs Web Server - chrisdb - May-27-2019 (May-26-2019, 09:40 PM)snippsat Wrote:(Apr-24-2019, 07:43 AM)chrisdb Wrote: - can I run a wsgi server, without using a web server to run a webapp (i.e. run an angular spa with a rest api in flask with waitress alone)?The work flow with eg Flask is building the web-app is all done local with Development Server(wsgi) that come with Flask. I don't have the intention to share my SPA with the world. The application I've written is for local use only. So only 1 user at a time is required. That's why I asked if it is necessary to use a web server if I already have a wsgi server. Btw I refer to waitress because I want to run my app on Windows too. RE: WSGI server vs Web Server - snippsat - May-27-2019 (May-27-2019, 07:35 PM)chrisdb Wrote: I don't have the intention to share my SPA with the world.Then can just use the build in web-server that come with Flask,it works fine on all OS. Look at this post for a basic setup,so python app.py is starting the build in web-server.E:\all_flask\2019\my_app λ python app.py * Serving Flask app "app" (lazy loading) * Environment: production WARNING: Do not use the development server in a production environment. Use a production WSGI server instead. * Debug mode: on * Restarting with stat * Debugger is active! * Debugger PIN: 334-187-997 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) RE: WSGI server vs Web Server - Skaperen - May-28-2019 (May-27-2019, 07:19 PM)snippsat Wrote:i have already read that page. it came close to revealing what i wanted to know. i guess i will have to read the PEPs. PEPs tend to be hard to read.(May-27-2019, 06:36 PM)Skaperen Wrote: s a HTTP to API interfacer. if i got that right,Look at Full Stack Python WSGI Servers for more info. (May-27-2019, 07:19 PM)snippsat Wrote:a lot of things in C are not pleasant, but i have done them. i'm not the typical programmer. i learned assembly language a decade before i learned C. maybe, i won't find WSGI difficult. but i'll have to see it or try it to know for sure.Quote:then i still need to learn it, eventually, to do web development (as opposed to using an existing framework).Using WSGI directly for web-development is not a pleasant thing,people who want to create yet another Python web-framework most read the WSGI specification. (May-27-2019, 07:19 PM)snippsat Wrote: Look at Werkzeug it's a thinner layer over WSGI.i did find Django confusing. i tend to be confuse by abstraction when i start from the abstract side. if i start from the concrete side, i can better understand what is going on. |