TypeError: ObjectId(”) is not JSON serializable
My response back from MongoDB after querying an aggregated function on document using Python, It returns valid response and i can print it but can not return it.
My response back from MongoDB after querying an aggregated function on document using Python, It returns valid response and i can print it but can not return it.
My images are stored in a MongoDB, and I’d like to return them to the client, here is how the code is like:
Half of my Flask routes requires a variable say, /<variable>/add or /<variable>/remove. How do I create links to those locations?
I’d like to know the reasoning behind using url_for to generate links in templates and the application code.
I am trying to allow the user to download a CSV file with data defined by their actions. The file doesn’t exist, it’s created dynamically. How can I do this in Flask?
I want to implement a command which can stop flask application by using flask-script.
I have searched the solution for a while. Because the framework doesn’t provide app.stop() API, I am curious about how to code this. I am working on Ubuntu 12.10 and Python 2.7.3.
I have a Flask view that generates data and saves it as a CSV file with Pandas, then displays the data. A second view serves the generated file. I want to remove the file after it is downloaded. My current code raises a permission error, maybe because after_request deletes the file before it is served with send_from_directory. How can I delete a file after serving it?
I found this code that times each response, but I’m not sure where g is supposed to come from. What is g?
When building a Flask service in Python and setting the debug mode on, the Flask service will initialise twice. When the initialisation loads caches and the like, this can take a while. Having to do this twice is annoying when in development (debug) mode. When debug is off, the Flask service only initialises once. How … Read more
I am trying to build a small site with the server push functionality on Flask micro-web framework, but I did not know if there is a framework to work with directly.