[Fixed]-Django can't get function from one view to another view

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.

Leave a comment