Search code examples
pythonflaskcommand-promptdevelopment-environmentproduction-environment

While using python-flask, even after setting my environemnt to development mode it shows Environmeent:production in my Anaconda command prompt


This is my command prompt message showing the environment

(base) C:\Python\flask\url-shortener>set FLASK_APP = app.py

(base) C:\Python\flask\url-shortener>set FLASK_ENV = development

(base) C:\Python\flask\url-shortener>flask run * Environment: production WARNING: Do not use the development server in a production environment. Use a production WSGI server instead. * Debug mode: off * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

This is my app.py code

from flask import Flask

hello = Flask(name)

@hello.route('/') def home(): return 'Hello Flask!'


Solution

  • Try it without the spaces around =

    > set FLASK_APP=app.py
    > set FLASK_ENV=development
    

    Now try to start the server. It should work!