Issue
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
I am new to Flask. I wrote this basic code and save it in hello.py in my D:\Cat_vs_Dog\scripts folder.
Then in command prompt, I wrote the following commands.
C:\Users\Ketan Ingale>set FLASK_APP=D:\Cat_vs_Dog\scripts\hello.py
C:\Users\Ketan Ingale>flask run
* Serving Flask app "D:\Cat_vs_Dog\scripts\hello.py"
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
Usage: flask run [OPTIONS]
Error: Could not import "D".
I am getting this error. What should I do...?
Solution
Remove the directory and just use the name of the file and retry.
You might need to CD
to the directory with your file in it also.
Answered By - Swift
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.