I'm trying to make an project with flask, but somehow, even if i installed it, i just cannot use flask!
i've tried to change the from Flask import Flask, render_template, request
command by just import Flask
, but nothing happen, could anyone help, please? Here is the code, if necessary:
import Flask
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
It's
from flask import Flask
# 1st lowercase
The import is from flask import Flask
.
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
You could try to import this:
from flask import Flask
from flask import request
from flask import make_response
Are you sure that you have installed flask correctly?
sudo pip install Flask
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.