# 属性错误：'Flask'对象没有属性'method'

- **ID:** `python/flask-attributeerror-flask-object-has-no-attribute-method`
- **领域:** python
- **类别:** type_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

尝试调用Flask应用对象上不存在的方法，通常是由于拼写错误或对象错误。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **Check Flask documentation for correct method** (90% 成功率)
   ```
   Use app.route() instead of app.get() for defining routes.
   ```
2. **Use dir() to list available attributes** (85% 成功率)
   ```
   print(dir(app))
   ```

## 无效尝试

- **Assuming Flask has all common methods** — Flask has specific methods; not all are available. (50% 失败率)
- **Confusing Flask with other frameworks** — Methods like 'get' or 'post' are not Flask methods. (80% 失败率)
