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


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:


or try to do the import like this:

from v1.views import get_data_from_text_file


Leave a comment