Python (Django) auto-completion not working

Describe the Bug

I have been using cursor for some time in my backend work which is centered around Django and FastAPI, but a week ago the auto-complete is not working and click to inspect also not working I tried a lot of solutions none worked. I tried to import my extensions from vscode also and it did not work. there are two screenshots below one from cursor and one from vscode to seed the difference.

Steps to Reproduce

provided above

Screenshots / Screen Recordings

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.2.4 (Universal)
VSCode Version: 1.99.3
Commit: a8e95743c5268be73767c46944a71f4465d05c90
Date: 2025-07-10T16:55:16.443Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0

Does this stop you from using Cursor

No - Cursor works, but with this issue


this is a screenshot from vscode to pinpoint the difference

Hi @atef_hesham, could you install the Python extension, and double check that the correct Python interpreter is selected (cmd/ctrl-shift-p, then "Python: Select Interpreter)?

I did that and nothing changed I don’t know what exactly the problem is

Hi @atef_hesham, could you confirm whether jump to definition (cmd/ctrl-click) is working for any objects (e.g. in your screenshot, does it take you to the definition of the BaseCommand class?) If so, then this would indicate that we’re unable to infer the type of PlanPrice.objects.update_or_create. Could you double check that the setting cursorpyright.analysis.useLibraryCodeForTypes is enabled?

The jump to definition is not working for the objects manager and I doubled checked the setting cursorpyright.analysis.useLibraryCodeForTypes and it is indeed enabled. the issue remains unsolved I tried to uninstall and reinstall cursor and also imported the settings from vscode and nothing solved the issue

Hi @atef_hesham, could you try using the pyrefly or ty extensions? These are alternative Python language servers that are written in Rust and are more performant. They might be better able to understand the Django types.


Unfortunately these extensions did not work either

I’m guessing that you were getting type stubs from Pylance in VSCode. You can install the stubs which Pyright/Pyrefly will then pick up automatically to give you hover/autocomplete: GitHub - sbdchd/django-types: 🍩 Type stubs for Django.

1 Like

This worked, thanks a lot. I hope cursor team fixes this issue in the future

I created a task against Pyrefly and hope it can be included in a future release. Bundle popular types libraries with the extension · Issue #785 · facebook/pyrefly · GitHub

1 Like

Will keep an eye on it, thanks for your effort

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.