Skip to content

Instantly share code, notes, and snippets.

@kaniket7209
Created December 1, 2021 07:03
Show Gist options
  • Save kaniket7209/91d16842494facce4cead8eb34370827 to your computer and use it in GitHub Desktop.
Save kaniket7209/91d16842494facce4cead8eb34370827 to your computer and use it in GitHub Desktop.
Hello, World with Flask
1. Why Flask is called a microframework?
Answer: Flask is called a microframework because Flask only provides core features such as request, routing, and blueprints. For other features, such as Caching, ORM, forms, etc., we need to make use of Flask-Extensions.
2. Why flask is not good for production?
Answer: Flask's built-in server is not suitable for production as it doesn't scale well and by default serves only one request at a time.
3. What is WSGI in Flask?
Answer: WSGI (Web Server Gateway Interface) is an interface between web servers and web apps for python. mod_wsgi is an Apache HTTP server module that enables Apache to serve Flask applications.
4. Who created Flask?
Answer: Armin Ronacher created the Flask framework. Flask was born out of April fool Joke in 2011.
5. Why do we use Flask?
Answer: Flask is used to create Web applications using Python programming language. Flask is a microframework that is also used for quick prototyping web and networking based applications.
6. What is the default host port and port of Flask?
Answer: Flask default host is a localhost (127.0.0.1), and the default port is 5000.
7. How to change default host and port in Flask?
Answer: Flask default host and port can be changed by passing the values to host and port parameters while calling run method on the app.
example - if __name__ == "__main__":
app.run(host="0.0.0.0", port=8080)
1. Flask is a web development framework, created in which language ?
a) C
b) Java
c) Python
d) Javascript
Answer: c) Python
2. Is the Flask framework open source?
a) TRUE
b) FALSE
c) Can be True can be False also
d) unpredictable
Answer: a) TRUE
3. The defalut port of Flask is ?
a) 3000
b) 2000
c) 5000
d) 4000
Answer: c) 5000
4. The default host of Flask is localhost(127.0.0.1)
a) True
b) False
Answer: a) True
5. Flask is a?
a) miniframework
b) microframework
c) peraframework
d) nanoframework
Answer: b) microframework
6. Which of the following are the benefits of using the Flask framework?
a) It has an inbuilt development server.
b) It has vast third-party extensions.
c) It is WSGI compliant.
d) All of the above
Answer: d) All of the above
7. WHat is the command to install flask ?
a) pip install Flask
b) pip install flask
c) pip install FLASK
d) All of the above
Answer: d) All of the above
8. Can we change the default host and port of Flask?
a) Yes
b) No
Answer: a) Yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment