Automatic Model imports don't work!
See original GitHub issueWhen I run shell_plus, it instantly prints out all the models it found in all my apps. Then it gives me these nice lines, which imply that the classes were really auto-imported, which is so impressive and reassuring:
Shell Plus Model Imports
from b2bpay.apps.transactions.models import Attachment
But they aren’t! Why not? Why is it printing stuff out when it hasn’t actually imported anything?
In [2]: Attachment
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-2-c74e9844aceb> in <module>()
----> 1 Attachment
NameError: name 'Attachment' is not defined
So I even defined SHELL_PLUS_POST_IMPORTS:
Shell Plus User Imports
from b2bpay.apps.onboard.models import *
from b2bpay.apps.wizard.models import *
But again, no class got imported.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Auto-import doesn't work · Issue #28 · microsoft/pylance-release
The auto-import still is not working in some cases. I have defined variable (type alias) ImagePil = PIL.Image.Image in one module. When I...
Read more >Visual Studio Code Automatic Imports - typescript
Yes, auto-imports work great on Mac out of the box regardless of if your project's version of typescript matches with what shipped with...
Read more >Confused as to why this import is not mapping automatically
I am trying to build a process where end users can upload values into an input module. Ideally they can export out the...
Read more >Auto import | WebStorm Documentation - JetBrains
In JavaScript and TypeScript files, WebStorm automatically adds import statements for modules, classes, components, and any other symbols ...
Read more >import - JavaScript - MDN Web Docs - Mozilla
Modules are automatically interpreted in strict mode. There is also a function-like dynamic import() , which does not require scripts of ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same problem here with ipython on a clean ubuntu 18.04 install. On my previous Ubuntu 16.04 everything was working fine. Now resolved to bpython, which does work!
If I don’t use ipython (shell_plus --plain), the auto imports work fine.
–bpython also works fine.
It’s strange since I have another project with the same versions of extension, django and ipython and it works just fine.