Add this config line to your code after the app definition:
app = Flask(__name__)
app.config['JSON_SORT_KEYS'] = False
Update: For Flask 2.3 and later use this:
app.json.sort_keys = False
Related Contents:
- How to execute raw SQL in Flask-SQLAlchemy app
- Passing HTML to template using Flask/Jinja2
- What is the purpose of Flask’s context stacks?
- Deploying a minimal flask app in docker – server connection issues
- ImportError: No module named MySQLdb
- How to stop flask application without using ctrl-c
- Get raw POST body in Python Flask regardless of Content-Type header
- Making an asynchronous task in Flask
- How to iterate through a list of dictionaries in Jinja template?
- Sending data from HTML form to a Python script in Flask
- How to send requests with JSON in unit tests
- secret key not set in flask session, using the Flask-Session extension
- Flask Download a File
- What is the difference between the declarative_base() and db.Model?
- Static files in Flask – robot.txt, sitemap.xml (mod_wsgi)
- WTForms: Install ’email_validator’ for email validation support
- Flask to return image stored in database
- ‘No application found. Either work inside a view function or push an application context.’ [duplicate]
- Application not picking up .css file (flask/python) [duplicate]
- What is the cause of the Bad Request Error when submitting form in Flask application?
- How to build a flask application around an already existing database?
- Why is Flask application not creating any logs when hosted by Gunicorn?
- Heroku truncates HTTP responses?
- Flask Python Buttons
- redirect while passing arguments
- RuntimeError: working outside of application context
- When scattering Flask Models, RuntimeError: ‘application not registered on db’ was raised
- How to send image generated by PIL to browser?
- NameError: name ‘request’ is not defined
- Websockets in Flask
- Flask – Accessing the config variable in the template
- Support multiple API versions in flask
- Avoiding “MySQL server has gone away” on infrequently used Python / Flask server with SQLAlchemy
- In Flask convert form POST object into a representation suitable for mongodb
- Flask user authentication
- flask restful: passing parameters to GET request
- Method Not Allowed flask error 405
- Sending a form array to Flask
- Flask broken pipe with requests
- What is the purpose of using nginx with gunicorn? [duplicate]
- Jinja Templates – Format a float as comma-separated currency
- How to show a pandas dataframe into a existing flask html table?
- .ini file load environment variable
- AttributeError: ‘Flask’ object has no attribute ‘user_options’
- Using basic Flask vs Flask-RESTful for API development
- Changing the active class of a link with the twitter bootstrap css in python/flask
- Gunicorn can’t find app when name changed from “application”
- SQLAlchemy delete doesn’t cascade
- how to run gunicorn on docker
- Handling GET and POST in same Flask view