0

just a basic code:

from flask import Flask
app = Flask(__name__)
@app.route('/')
def Page(): 
    return 'This is a test'

app.run(debug=True)

When I run this, I get the message: AttributeError: module '__main__' has no attribute '__package__'

(it all has to do with debug=True)

I know I can start Flask in debug mode by set FLASK_DEBUG=1 in cmd. But the error message annoys me because I have no clue where it comes from and how to solve it :-)

Thx Peter

mforsetti
  • 383
  • 4
  • 7

1 Answers1

1

Try using:app.debug = True instead or app.config['DEBUG'] = True