I installed flask plugin in PyCharm Community Edition and I just have this simple code in my flask app:

from flask import Flask
app = Flask(__name__)

def index():
    return '<h1>Hello!</h1>'

if __name__ == "__main__":

And I get this message:

WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead

Restarting with stat
* Debugger is active!
* Debugger PIN: 138-642-273
* Running on

When I come to it says: "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."


Unless you tell the development server that it's running in development mode, it will assume you're using it in production and warn you not to.

Enable development mode by setting the FLASK_ENV environment variable to development.

export FLASK_ENV=development
flask run

If you're running in PyCharm (or probably any other IDE) you can set environment variables in the run configuration.

Development mode enables the debugger and reloader by default. If you don't want these, pass --no-debugger or --no-reloader to the run command.