Hello Guys, How are you all? Hope You all Are Fine. Today I am just trying to run simple flask code and I am facing following error WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead in python. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
- How WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead Error Occurs ?
- How To Solve WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead Error ?
- Solution 1: use Waitress
- Solution 2: Enable development mode by setting the
FLASK_ENV
environment - Summary
How WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead Error Occurs ?
I am just trying to run simple flask code and I am facing following error.
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead
* Restarting with stat
* Debugger is active!
* Debugger PIN: 123-456-789
* Running on http://127.0.0.1:5000/
How To Solve WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead Error ?
How To Solve WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead Error ?
To Solve WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead Error This application is running in development mode and you’re using it in production Thats why you are facing this error Here you should use Waitress a production WSGI server. If you are deploying your application to production then you have to use waitress. Follow this simple example.
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead
To Solve WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead Error This application is running in development mode and you’re using it in production Thats why you are facing this error Here you should use Waitress a production WSGI server. If you are deploying your application to production then you have to use waitress. Follow this simple example.
Solution 1: use Waitress
Here you should use Waitress a production WSGI server. If you are deploying your application to production then you have to use waitress. Follow this simple example.
from flask import Flask
app = Flask(__name__)
@app.route("/")
def index():
return "<h1>Hello World!</h1>"
if __name__ == "__main__":
from waitress import serve
serve(app, host="0.0.0.0", port=8080)
And then run your application with this command.
python hello.py
Solution 2: Enable development mode by setting the FLASK_ENV
environment
This application is running in development mode and you’re using it in production Thats why you are facing this error. Just Enable development mode by setting the FLASK_ENV
environment variable to development
.
export FLASK_APP=example
export FLASK_ENV=development
flask run
Summary
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read