How to import a class from a python file in django? -
i'm using django , putting python code in views.py run them on webpages. there excerpt of code requires class python file work sort of package python file given use in order execute piece of code. how able reference class python file in django views.py file? have tried putting python file in site packages folder in anaconda3 folder , have tried using [name of python file] import [class name] in views.py file not seem recognize file exists in site packages folder. tried putting python file in django personal folder , using personal import [name of file] doesn't work either
you can put mypythonfile.py
in same directory of views.py
file. , from mypythonfile import mystuff
in views.py
Comments
Post a Comment