0
0
Flaskframework~10 mins

Flask extensions directory - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the Flask extension for database handling.

Flask
from flask_sqlalchemy import [1]
Drag options to blanks, or click blank then click option'
AFlask
BApp
CDatabase
DSQLAlchemy
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to import 'Flask' instead of the extension class.
Using 'Database' which is not the correct class name.
2fill in blank
medium

Complete the code to initialize the Flask-Mail extension in your app.

Flask
from flask_mail import Mail
mail = [1]()
Drag options to blanks, or click blank then click option'
AFlaskMail
BMailApp
CMail
DMailExtension
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'FlaskMail' which is not the correct class name.
Trying to instantiate 'MailExtension' which does not exist.
3fill in blank
hard

Fix the error in the code to correctly register the Flask-Login extension.

Flask
from flask_login import LoginManager
login_manager = LoginManager()
login_manager.[1](app)
Drag options to blanks, or click blank then click option'
Ainit_app
Bstart_app
Cregister
Dsetup
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'start_app' which is not a method.
Using 'register' or 'setup' which are incorrect.
4fill in blank
hard

Fill both blanks to create a Flask-WTF form class with a submit button.

Flask
from flask_wtf import FlaskForm
from wtforms import [1]

class MyForm(FlaskForm):
    submit = [2]('Submit')
Drag options to blanks, or click blank then click option'
ASubmitField
BStringField
DBooleanField
Attempts:
3 left
💡 Hint
Common Mistakes
Importing 'StringField' but using 'BooleanField' for submit.
Using 'SubmitField' in import but not in the class.
5fill in blank
hard

Fill all three blanks to create a Flask-Migrate migration setup.

Flask
from flask_migrate import [1]
migrate = [2]()
migrate.[3](app, db)
Drag options to blanks, or click blank then click option'
AMigrate
Cinit_app
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'start' instead of 'init_app'.
Confusing the class name with the method name.