werkzeug

ImportError: cannot import name 'url_quote' from 'werkzeug.urls'

ImportError: cannot import name 'url_quote' from 'werkzeug.urls' Question: Environment: Python 3.10.11 Flask==2.2.2 I run my Flask backend code in docker container, with BASE Image: FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime But when I run the pytest with version pytest 7.4.2, pip install pytest pytest it raised an Error, with logs: ==================================== ERRORS ==================================== _____________ ERROR collecting tests/test_fiftyone_utils_utils.py ______________ ImportError …

Total answers: 6

Django restarted (trigger file change) on every request when using runserver_plus

Django restarted (trigger file change) on every request when using runserver_plus Question: Django always detect file changes on every request on development mode. it was restarting even though i didn’t make any change at all on the code. for a simple view this is not causing a problem. the process of rendering one page done …

Total answers: 1

ImportError: cannot import name 'parse_rule' from 'werkzeug.routing'

ImportError: cannot import name 'parse_rule' from 'werkzeug.routing' Question: I got the following message after running my Flask project on another system. The application ran all the time without problems: Error: While importing ‘app’, an ImportError was raised: Traceback (most recent call last): File "c:usersUserappdatalocalprogramspythonpython39libsite-packagesflaskcli.py", line 214, in locate_app __import__(module_name) File "C:UsersUserDesktopProjektapp__init__.py", line 3, in <module> …

Total answers: 4

Werkzeug server is shutting down in Django application

Werkzeug server is shutting down in Django application Question: after updating the Werkzeug version from 2.0.3 to 2.1.0, I keep getting errors every time I run the server, and here is the error log: Exception happened during processing of request from (‘127.0.0.1’, 44612) Traceback (most recent call last): File "/usr/lib/python3.8/socketserver.py", line 683, in process_request_thread self.finish_request(request, …

Total answers: 2

ImportError: cannot import name 'safe_str_cmp' from 'werkzeug.security'

ImportError: cannot import name 'safe_str_cmp' from 'werkzeug.security' Question: Any ideas on why I get this error? My project was working fine. I copied it to an external drive and onto my laptop to work on the road; it worked fine. I copied it back to my desktop and had a load of issues with invalid …

Total answers: 6

werkzeug: disable bash colors when logging to file

werkzeug: disable bash colors when logging to file Question: In a Flask application, I use a RotatingFileLogger to log werkzeug access logs to a file like shown in this question: file_handler_access_log = RotatingFileHandler("access.log", backupCount=5, encoding=’utf-8′) formatter = logging.Formatter(‘%(asctime)s %(module)s %(levelname)s: %(message)s’, datefmt=’%Y-%m-%d %H:%M:%S’) file_handler_access_log.setFormatter(formatter) werkzeug_logger.addHandler(file_handler_access_log) werkzeug_logger.setLevel(logging.DEBUG) In the access.log file, the request looks like this: …

Total answers: 5

How to Hide Server/Software Version (Werkzeug & Python) from Superset Response Header?

How to Hide Server/Software Version (Werkzeug & Python) from Superset Response Header? Question: Any ideas/suggestions on how to hide software/server version in Superset? We hired an information security company to perform an external pen-testing in our servers and one of the issues raised was to hide all the software versions being disclosed on application headers/error …

Total answers: 2

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

When I do Flask run, it shows error : ModuleNotFoundError: No module named 'werkzeug.contrib'. Can anyone help me with this? Question: 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 locate_app __import__(module_name) File “/home/harshit/Documents/project1/application.py”, line 18, in <module> Session(app) File …

Total answers: 7

Troubleshooting Flask error werkzeug routing

Troubleshooting Flask error werkzeug routing Question: I am following a tutorial to do the simplest “Hello World” Flask app as described in: https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world For context, I have created the directory at the root of the C drive to avoid the potential path issues. I am running Python 3.8 and Flask 1.0.2 and werkzeug 0.15.2 Before …

Total answers: 5