Reputation: 5
from flask import flask
app = Flask(__name__)
@app.route('/'):
def index():
return 'hrllo'
I keep getting
Error: While importing 'application', an ImportError was raised.
Upvotes: 0
Views: 1257
Reputation: 614
Try:
from flask import Flask #changed "flask" to "Flask"
app = Flask(__name__)
@app.route('/') #removed ":"
def index():
return 'hello'
app.run() #added this line to run your application
Upvotes: 1
Reputation: 2920
from flask import Flask, correction in your first line.
Remove the colon at the end of the line marking the route
.
Also, you should do app.run()
at the end of the code snippet.
Upvotes: 1