Complete the code to create a basic Flask app that returns 'Hello World!'.
from flask import Flask app = Flask(__name__) @app.route('/') def home(): return [1]
The Flask route function must return a string. The correct return value is a string literal 'Hello World!'.
Complete the code to import Django's HttpResponse class.
from django.http import [1]
Django's HttpResponse class is used to send HTTP responses back to the browser.
Fix the error in this Flask route decorator to respond to the URL '/welcome'.
@app.route([1]) def welcome(): return 'Welcome!'
The route decorator requires the URL path as a string starting with a slash '/'.
Fill both blanks to create a Django view that returns 'Hello Django!'.
from django.http import [1] def hello(request): return [2]('Hello Django!')
The Django view must import HttpResponse and return an HttpResponse object with the string.
Fill all three blanks to create a Flask app with a route '/greet' that returns 'Greetings!'.
from flask import [1] app = [2](__name__) @app.route([3]) def greet(): return 'Greetings!'
Import Flask from flask, create app with Flask(__name__), and set route with '/greet'.