1π
β
To import a something from a module (file) in the same package (folder) you should use the relative import notation β using the dot. In your case use:
from .view1 import appcard
It also seems you have a typo in your code: first you say you have in the view1
file the function appcatd
and the you try to import appcard
. So you should import the exact name of the function.
π€doru
0π
Oh, it was actualy totall mess: I imported some function from view2 to view1,that uses function that uses some imported from view1 function. Sorry,rearranged functions and now its working fine.
- Django: select data from 2 models
- Django Integrity Error when adding post in a form that excludes a foreign key
- Get specific user information in Django template
- How to loop over a queryset for instantiate all formset?
Source:stackexchange.com