I am trying to pass comma separated query parameters to a Flask endpoint. An example URI would be: localhost:3031/someresource#?status=1001,1002,1003 Looking at the return of request.args or request.args.getlist(‘status’) I see that I only get a string. I know I can split the string by comma but that feels hacky. Is there a more idiomatic way to handle this in Flask? Or
Tag: flask
Flask app on Docker: Max retries exceeded with URL
I’m working on a simple Flask app for which I’m using the default template: I’m just calling a dummy function that return and ‘ok’ response: When I call it directly on my machine with the following code: It works without any issue, but if I run it from the docker image I get the following error: ConnectionError: HTTPConnectionPool(host=’localhost’, port=5000): Max
Is there a way to get the error raised from a Python program outside Docker container and handle it?
I have a container that runs a Python program and it can run in two ways, using docker exec in the localhost terminal or by making an API Rest request (that is outside the container) which executes the same command as it would be done by using the first method. What I am trying to do is whenever my Python
Flask Azure web app deployed successfully but showing default page
I deployed a python flask app with azure web service using local git. The status in the deployment center shows “success” but when i go to the web page, it is still the default page that tells me I’m running python 3.6.6. When i navigate to the kudu git clone uri it says ” no route registered for ‘/testapp1.git’ The
Why doesn’t Flask app enter GET method but does enter POST methods?
I apologize, this has to be a duplicate but I haven’t found anything that’s helped, so I imagine it must be an import or syntax issue? Also, I’m on crash course levels of Python and HTML here, and it’s finals week, so bear with me. I’m working on a homework assignment that specifies a HTML page must use a form
Setup custom launcher with paths as a param values in VS Code (Flask – certificate path)
There is an example in Visual Studio Code python setup tutorial it is shown how to setup Flask. My problem starts when I try to provide self-signed certificate paths. I’ve tried to add following configuration: I’ve tried to provide key/cert as: C:\FULL_PATH\TO\FILE C:/FULL_PATH/TO/FILE ‘C:\FULL_PATH\TO\FILE’ “C:\FULL_PATH\TO\FILE” and I always getting one of these error messages: Error: Invalid value for “–key”: “–cert”
werkzeug.routing.BuildError: Could not build url for endpoint ‘success’. Did you forget to specify values [‘name’]?
“werkzeug.routing.BuildError: Could not build url for endpoint ‘success’. Did you forget to specify values [‘name’]?” How to solve this error? I have tried many things but can’t solve it by myself. http_methods.py: I get an error in the login method, that value of [‘name’] is not specified; how to solve this error? login.html: output: I am using python 3.7 and
How do I zip an entire folder (with subfolders) and serve it through Flask without saving anything to disk
I have a folder structure on my web server that I would like to serve as a zipped archive through Flask. Serving a file through Flask is pretty straight forward through Flasks send_file: Zipping can get accomplished in various ways like with shutil.make_archive or zipfile, but i cannot figure out how to zip the whole directory in memory and then
Formatting on save moves import statment in VS-Code
I am learning flask and building a app based on Corey Schafer’s Youtube tutorials. I’m using VS-Code as my editor of choice. In tutorial 5 he splits his app into a package structure and when I do it I run into a problem. In my settings I enabled the “editor.formatOnSave”: true and the formatter I use is autopep8. Now when
Could not import “D”: FLASK_APP
I am new to Flask. I wrote this basic code and save it in hello.py in my D:Cat_vs_Dogscripts folder. Then in command prompt, I wrote the following commands. I am getting this error. What should I do…? Answer Flask v1.1.x https://flask.palletsprojects.com/en/1.1.x/cli/#application-discovery The above documentation link describes: The flask command is installed by Flask, not your application; it must be told