miguelgrinberg / APIFairy

A minimalistic API framework built on top of Flask, Marshmallow and friends.
MIT License
323 stars 30 forks source link

Disabling interactive web based debugger from Werkzeug and print to terminal #83

Open pascal-mueller opened 1 year ago

pascal-mueller commented 1 year ago

Hello,

if I understand it correctly, Flask uses Werkzeug and Werkzeug assumes we are in some MVC design pattern or something similar i.e. we are not a pure API. So they provide an interactive debugger and what not yet we can't really use that because with APIFairy, we make pure APIs.

This leads to things like seeing the interactive Werkzeug debugger resp. its HTML in the response in the documentation generated by APIFairy.

I figured, I probably can simply configure Flask or Werkzeug such that it dumps the information to the terminal but I just can't find any information as to how.

How exactly is this solved? How do I tell Flask or Werkzeug to simply print everything into the terminal/stdout?

miguelgrinberg commented 1 year ago

The Flask debugger is not enabled by default. You must have turned it one. Maybe by setting FLASK_DEBUG in the environment, or some other way. So you need to review your Flask app configuration and remove the debug setting.