Questions tagged [werkzeug]

Werkzeug is a WSGI utility library for Python. It's widely used and BSD licensed.

Werkzeug is a WSGI utility library for Python. It includes a debugger and fully featured request response headers. Also included is a set of HTTP utilities.

624 questions
18
votes
7 answers

Build error with variables and url_for in Flask

Have found one or two people on the interwebs with similar problems, but haven't seen a solution posted anywhere. I'm getting a build error from the code/template below, but can't figure out where the issue is or why it's occurring. It appears that…
Rob
  • 181
  • 1
  • 1
  • 4
18
votes
2 answers

Cannot run apache airflow after fresh install, python import error

after a fresh install using pip install apache-airflow, any attempts to run airflow end with a python import error: Traceback (most recent call last): File "/Users/\*/env/bin/airflow", line 26, in from airflow.bin.cli import CLIFactory File…
Jacob Thompson
  • 411
  • 3
  • 6
18
votes
2 answers

How to make Flask/ keep Ajax HTTP connection alive?

I have a jQuery Ajax call, like so: $("#tags").keyup(function(event) { $.ajax({url: "/terms", type: "POST", contentType: "application/json", data: JSON.stringify({"prefix": $("#tags").val() }), dataType:…
Bittrance
  • 2,202
  • 2
  • 20
  • 29
17
votes
1 answer

Flask app that routes based on subdomain

I want to have my top-level domain as a portal for various subdomains that correspond to different sections of my site. example.com should route to a welcome.html template. eggs.example.com should route to an "eggs" subsection or application of the…
sw00
  • 980
  • 2
  • 16
  • 29
17
votes
1 answer

Getting error with deployed Serverless Flask app on AWS, No module named 'werkzeug._compat'

I have created a simple Flask app and successfully deployed it to AWS Lambda. I am following the first steps of this tutorial. When the Lambda is run, the following error appears in the log: Unable to import module 'wsgi_handler': No module named…
sdugan
  • 225
  • 4
  • 8
17
votes
2 answers

Flask unit testing: Getting the response's redirect location

I have a Flask based webapp that occasionally creates new documents with new random keys when posting to their parent document in a certain way. The new key gets in the parent's data structure, the updated parent gets temporarily stored in the…
Michel Müller
  • 5,535
  • 3
  • 31
  • 49
17
votes
2 answers

How can I get value of the nested dictionary using ImmutableMultiDict on Flask?

address_dict = {'address': {'US': 'San Francisco', 'US': 'New York', 'UK': 'London'}} When above parameters was sent via requests, how can I get values in address key using request.form on Flask? import requests url = 'http://example.com' params…
kinakomochi
  • 475
  • 4
  • 8
  • 14
16
votes
1 answer

Python requests return 504 in localhost

I run werkzeug server (via Flask) and trying to connect to localhost by requests lib and got 504 error, but if open http://127.0.0.1:5000/ in browser - anything ok. My code: import requests r =…
Konstantin Rusanov
  • 6,414
  • 11
  • 42
  • 55
15
votes
7 answers

When I do Flask run, it shows error : ModuleNotFoundError: No module named 'werkzeug.contrib'. Can anyone help me with this?

the exact error I get is : flask.cli.NoAppException: While importing "application", an ImportError was raised:Traceback (most recent call last): File "/home/harshit/.local/lib/python3.6/site-packages/flask/cli.py", line 240, in …
Harshit
  • 153
  • 1
  • 1
  • 4
15
votes
3 answers

Flask werkzeug request.authorization is none but Authorization headers present

I am POSTing some JSON data and adding an Authorization header. However, the request object does not have the correct authorization property. HTTP_AUTHORIZATION and headers both show the proper authorization details. {'authorization': None, …
Patrick Yan
  • 2,338
  • 5
  • 25
  • 33
15
votes
1 answer

Flask: 'Response' object is not iterable with response-producing exceptions

I can't seem to generate responses from exceptions anymore in Flask 0.10.1 (the same happened with 0.9). This code: from flask import Flask, jsonify from werkzeug.exceptions import HTTPException import flask, werkzeug print 'Flask version: %s' %…
jd.
  • 10,678
  • 3
  • 46
  • 55
15
votes
3 answers

Flask route giving 404 with floating point numbers in the URL

I have the following route definition in my Flask app's server.py: @app.route('/nearby//') def nearby(lat, long): for truck in db.trucks.find({'loc': {'$near': [lat, long]}}).limit(5): if truck.has_key('loc'): …
tldr
  • 11,924
  • 15
  • 75
  • 120
14
votes
2 answers

Werkzeug AttributeError: 'module' object has no attribute 'InteractiveInterpreter'

Using Flask (0.8) and Werkzeug (0.8.1) when attempting to run code with app.run(debug=True) I get the below described error. There are no errors when using app.run() The error Traceback (most recent call last): File "code2.py", line 9, in
Jeff
  • 3,879
  • 3
  • 26
  • 28
14
votes
2 answers

Accessing all cookies in the Flask test response

After I make a request with the Flask test client, I want to access the cookies that the server set. If I iterate over response.headers, I see multiple Set-Cookie headers, but if I do response.headers["Set-Cookie"], I only get one value.…
datacubed
  • 189
  • 1
  • 10
14
votes
2 answers

Get the Flask view function that matches a url

I have some url paths and want to check if they point to a url rule in my Flask app. How can I check this using Flask? from flask import Flask, json, request, Response app = Flask('simple_app') @app.route('/foo/', methods=['GET']) def…
Phillip Martin
  • 1,910
  • 15
  • 30
1 2
3
41 42