[Solved]-How to import and run a django function at the command line

16👍

First of all make sure you’re using manage.py shell and not plain python in the command line to make this test.

You’re not importing the get_data_from_text_file function, but all the view. You could either use:

v1.views.get_data_from_text_file(“kk”)

or try to do the import like this:

from v1.views import get_data_from_text_file

👤Phob1a

Leave a comment