Search code examples
pythonflaskeve

What does 'Environment: production' mean for python-eve?


I followed the quick start guide and created a simple Eve app. In the console, I saw below messages.

 * Serving Flask app "eve" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 ...

I checked the Development / Production section of the document but could find anywhere mentions the Environment setting. More specifically, I could not figure out:

  • How does eve decide if the environment is in development or production?
  • Besides the settings provided, does eve app apply different settings to a different environment?
  • Can I change the Environment name from the settings? E.g. Environment: docker-dev.

Solution

  • Flask comes with a built-in web server to allow you to test your work but it is not secure or robust enough to run a live system that will be exposed to the public. For that you should deploy your Flask app using a full-strength server. Instructions are available on the Flask website. Personally I like Gunicorn.

    https://flask.palletsprojects.com/en/1.1.x/deploying/wsgi-standalone/