# RuntimeError: The current Flask app is not registered with this 'SQLAlchemy' instance.

- **ID:** `python/flask-sqlalchemy-no-application-found`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

db = SQLAlchemy() was created in a module but db.init_app(app) was never called, or a different app instance is active.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   db = SQLAlchemy()
def create_app():
    app = Flask(__name__)
    db.init_app(app)
    return app
   ```
2. **** (90% success)
   ```
   app = create_app()
with app.app_context():
    db.create_all()
   ```

## Dead Ends

- **** — Instance still lacks the app binding. (90% fail)
- **** — Creates two instances; models attach to the wrong one. (85% fail)
