The Werkzeug 3 upgrade broke imports
Werkzeug 3 moved or removed several helpers that older Flask and extension code reached into directly. Pinning stops the bleed, upgrading fixes it properly.
Running on current Werkzeug and Flask
Running Flask?
A lot of Flask apps that reach us were written in a hurry by a founder or a single engineer, grew organically, and then stayed in production for a decade. The Python interpreter is old, the dependencies are pinned to versions pip warns about, and nobody is quite sure which endpoints still get traffic. We work through it, upgrade what can be upgraded, document what cannot, and leave you with something a modern team can actually maintain.
What it is
Flask is a Python micro-framework for the web, created by Armin Ronacher in 2010. It is intentionally small, sitting on top of the Werkzeug WSGI toolkit and the Jinja2 template engine, with the philosophy that you add only the pieces your app actually needs. Its minimal core and clear request/response model made it the default pick for a long stretch of Python web development.
The Pallets Projects maintains Flask alongside Werkzeug, Jinja, Click and itsdangerous. Flask 2.0 added async view support, and Flask 3 tightened the extension story and dropped older Python versions. Typical production setups put gunicorn or uWSGI in front of a Flask app, SQLAlchemy for the ORM, Flask-Migrate (Alembic) for schema changes, and Redis for background jobs with RQ or Celery.
The honest version
No technology is all upside. This is where Flask earns its place and where it tends to cause trouble.
Sound familiar?
The Flask problems that bring people to us, and what you have once each one is fixed.
Werkzeug 3 moved or removed several helpers that older Flask and extension code reached into directly. Pinning stops the bleed, upgrading fixes it properly.
Running on current Werkzeug and Flask
A Flask app on Python 2 or Python 3.7, picking up no security fixes, with dependencies that cannot be upgraded further on the old interpreter.
On a supported Python with tests green
A Celery or RQ worker trying to use Flask-SQLAlchemy without pushing an app context, so every ORM call dies before touching the database.
Context handled, workers happy
An app built by a founder or former contractor, running on a server with SSH keys half-rotated, and a requirements.txt nobody has updated in five years.
App documented and under your control
A slow database query, a synchronous call to a third-party API with no timeout, or an N+1 ORM query running inside a request past the gunicorn timeout.
Requests complete within the budget
An unhandled exception leaving the session in a rolled-back state, a session reused across threads, or long-lived sessions that have not been disposed of.
Sessions clean, scoped per request
Development defaults running in production, no CSRF on forms, cookies without Secure or HttpOnly, and no CORS policy, which together make the app fail a basic audit.
Production-grade defaults applied
Pinned versions three to six years old, conflicting transitive deps, and a resolver that cannot produce a clean install on a modern Python.
Dependencies clean and installable
What we do
Hand us one failing endpoint, or the whole Flask codebase.
How it works
Tell us what's going wrong. We look at it, then tell you plainly what's wrong and what it will cost.
We fix the cause, not the symptom. If something is down, getting it back up comes first.
Backups, monitoring, updates and access, so the same problem can't quietly come back.
You get a plain-language write-up. Or we stay on for hosting, upkeep and new work.
Often found together
We work on the whole stack, so the problem can be wherever it actually is.
Yes, and it is one of the most common rescue jobs we see. The plan depends on what the app actually uses. In most cases it is: lock the current behavior under tests, port step by step to Python 3 and current Werkzeug, update SQLAlchemy and the extension set, and finally move the hosting to a supported runtime. We aim for parity first, improvements second.
Sometimes, but not always. If the app is sync HTTP with a mature extension footprint, moving to FastAPI for its own sake is often more cost than benefit. If the app is API-only, uses async-heavy I/O, or needs OpenAPI generation and better type ergonomics, FastAPI pays back the migration. We will tell you plainly which case you are in.
This almost always comes from code running outside a request or without `app.app_context()`. The common culprits are background workers (Celery, RQ) that did not wrap their task in a context, test fixtures that import extensions eagerly, and scripts that import Flask-SQLAlchemy models before the app is initialized. The fix is explicit context handling in the right places.
Yes, this is a large share of what we do. We inventory routes, blueprints, extensions and infra, bring credentials and deployment into your accounts, pin the dependency tree, and leave you with a repo and a runbook. From that point we either keep maintaining it or hand it to your internal team.
Almost always by fixing database access first. N+1 queries, missing indexes, large result sets loaded into memory and sessions held open across slow I/O are the real causes of slow Flask apps, far more than framework overhead. We profile the real traffic, fix the hot path, and only then look at workers and caching.
A quote costs nothing. Share the repo link or a note on what is broken, and a price arrives before any engineer begins work.
Free estimate
Tell us what you're running and what's going wrong. A person reads it and comes back with an estimate.
Your message is with a real person, and we'll get back to you soon.
Rather talk now? Call us: