what is the difference between static and dynamic websites? 1

what is the difference between static and dynamic websites?

Static Websites:- in static websites, content can't be changed after running the script. you cannot change anything in the site as it is predefined.
Dynamic websites:- in dynamic websites, content of script can be changed at the run time. its content is regenerated every time a user visits or reloads.

Here is what the above code is Doing:
1. We are importing the Flask class from the flask module.
2. We are creating an instance of the Flask class. The first argument is the name of the application’s module or package. If you are using a single module (as in this example), you should use __name__ because depending on if it’s started as application or imported as module the name will be different (‘__main__’ versus the actual import name). This is needed so that Flask knows where to look for templates, static files, and so on. For more information have a look at the Flask documentation.
3. We are creating a Flask route where requests to the URL / will be handled by the hello_world() function.
4. The hello_world() function returns the message ‘Hello, World!’ to the user.
5. Finally we are running the application using the run() method.

Similar Posts