Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Flask Interview Questions and Answers

Test your skills through the online practice test: Flask Quiz Online Practice Test

Ques 6. How to add an emailing function in Flask?

Yes, we can add an emailing function in the Flask framework. Actually, we need to install the Flask-Mail extension. We can use the given below command:

Pip install Flask-Mail 

Now, after installation, we need to go to the Flask Config API. Under config, we will get Mail-Server, Mail_Port, Mail_username, Mail_Password, etc options. We can use the mail.send() method to compose the message.

from flask_mail import Mail,Message 
from flask import Flaskapp=Flask(_name_)
mail=Mail(app)
@app.route(\"/mail\")
def email():
Msg=Message(\"Hello Message\",Sender=\"admin@test.com\",recipients=[\"to@test.com\"])
Mail.send(msg)

Is it helpful? Add Comment View Comments
 

Ques 7. What is WSGI?

The full form of WSGI is Web Server Gateway Interface. This is actually a Python standard in PEP 3333. It provides the protocol for web servers to communicate with a web application. 

It mainly plays a role at the time of project deployment.

Is it helpful? Add Comment View Comments
 

Ques 8. What is the default local host and port in Flask?

The default Flask local host is 127.0.0.1 and the default port is 5000.

Is it helpful? Add Comment View Comments
 

Ques 9. What is Flask-wtf?

It provides an easy integration process with WTForms.

Is it helpful? Add Comment View Comments
 

Ques 10. What features are available in Flask-wtf?

A few features are as follows:

  1. Integration with WTForms.
  2. CSRF token provides security globally.
  3. Provide Recaptcha.
  4. File upload facility.

Is it helpful? Add Comment View Comments
 

Most helpful rated by users:

©2024 WithoutBook