I would like to know if there is a way to directly run a python function directly from a file by just mentioning the filename followed by the function in a single line.
For example, lets say I have a file 'test.py' with a function 'newfunction()'.
python test.py newfunction
python manage.py runserver
I think you should take a look at:
All those commands like
dbshell etc. are implemented like how it was described in that link:
Applications can register their own actions with manage.py. To do this, just add a management/commands directory to the application.
Django will register a manage.py command for each Python module in that directory whose name doesn’t begin with an underscore.