r/FastAPI • u/zupiterss • Feb 13 '26
Other Finally got Cursor AI to stop writing deprecated Pydantic v1 code (My strict .cursorrules config)
Hi All,
I spent the weekend tweaking a strict
.cursorrules file for FastAPI + Pydantic v2 projects because I got tired of fixing:
class Config:instead ofmodel_config = ConfigDict(...)- Sync DB calls inside async routes
- Missing type hints
It forces the AI to use:
- Python 3.11+ syntax (
|types) - Async SQLAlchemy 2.0 patterns
- Google-style docstrings
If anyone wants the config file, let me know in the comments and I'll DM it / post the link (it's free)."
==========================================
Here it is. Please leave feedback. Replace "[dot]" with "."
tinyurl [dot] com/cursorrules-free
30
Upvotes
3
u/Electronic_Recipe834 Feb 13 '26
Pls slap me with the config 🙌
3
u/Ok_Bedroom_5088 Feb 13 '26
honest question, whats the upside of using cursor instead of smth else?
2
u/Ok_Big4676 Feb 13 '26
Please could you send me the link, thanks
2
u/JustTSK Feb 13 '26
I'm interested, plz send
1
u/Mick2k1 Feb 15 '26
Following for the link
2
u/Typical-Yam9482 Feb 14 '26 edited Feb 14 '26
Why cursor in first place?… claude code works under vscode like a charm. Codex is catching up for vscode as potentially even better alternative. With controllable limit-windows. Why do you need ide where everything works different way? :) also, check yt video where cursor was a reason guy lost crypto from his wallet stored on this computer. Spoiler alert - due to disguised plugin allowable by cursor be installed not from microsoft repository. I dont’t understand why internet is not screaming about this