I am taking a course on how to build a simple web app using Flask and Python.
I have stumbled upon the term “web server”.
This is pretty confusing and I would like to know what is it actually a web server. Is a web server referring to a computer hosting websites or is it referring to the flask web-app itself which is responsible to deal with the HTTP requests and response?
Link to MDN and EdX CS50:
Hey @JY93 I can’t access the course, but I think there is a spelling error or just something said that is not 100% percent correct.
Flask, like Django, Ruby on Rails, etc. are webframeworks that enables programmers to use Programming languages like Python or Ruby to make interactive webpages aka webapps.
But you need a webserver to serve your website to the world and take the input from the users. You definitively could make a webserver with Python if you want, maybe where are some, but Flask is something that needs a webserver. Flask and Django have a built-in Server for development purposes. But that development-server is not Flask, it’s just a helper tool.
I drew a little diagram to help you understand the connections between the different parts that are involved when you view a website:
- The most underlying thing is the hardware, a powerful computer called server.
- This server is operated by the operating system, called OS. For web servers this is mostly a Linux (Like Debian, Ubuntu, etc.).
- The OS runs a programming language like Python or Ruby. With that you can make the OS do some things.
- The programming language then runs a software called web framework like Flask or Django. The Framework is used to make a interactive web page. It will generate HTML pages, call and write data to a database, etc.
- Also installed in the OS is another software called web server (Apache, NGINX). This software is used to serve the content of the web framework to the world (internet).
- The internet transports your website from the web server to the user.
- The user requests the site, reads it and give it some data. This data is served back over the internet to the web server and from there to the web framework.
Note: You can make a so called static web-page with HTML and CSS only. This site doesn’t need a web framework. It just needs a Webserver to server the files to the internet. But this site is not able to get input from a user, it is read only.
I hate to say this but that is a very advanced topic for a beginner. Is this your first programming class? Did you pay money for this? How far into the course does this exercise show up?
I ask because, there’s no way writing a web server should be considered a beginner topic, and if you paid money for the course you should request a refund.
But, tell me more.
I also got more information from https://netgears.support/netgear-genie-support about the web server and also about networking.
No disrespect intended @JY93 but that course you highlighted is aimed at Intermediates. If you are unfamiliar with the function and purpose of a ‘web server’, I’d take a beginner course first.