0

I have created a function in views.py which is

def func(request)
    # …

Basically, I tried using the variable var, in another python file, say z.py, by typing:

from views import func

but I got the error

ImportError: cannot import name func.

Please help me out. I want to use the variable var in the other python script, but am getting this error.

Stphane
  • 3,368
  • 5
  • 32
  • 47

1 Answers1

0

Check out if you have a __init__.py file under the directory appname.

Marc Sances
  • 2,402
  • 1
  • 19
  • 34