I know how to reload a regular Python module within a regular Python interpreter session. This question documents how to do that pretty well:
How do I unload (reload
Enable IPython autoreload extension before importing any code:
%load_ext autoreload
%autoreload 2
I use it with the regular django shell and it works perfectly, although it does have some limitations:
*Caveats:
Reloading Python modules in a reliable way is in general difficult, and unexpected things may occur. %autoreload tries to work around common pitfalls by replacing function code objects and parts of classes previously in the module with new versions. This makes the following things to work:
Some of the known remaining caveats are:
source: https://ipython.org/ipython-doc/3/config/extensions/autoreload.html#caveats
Another great option is to write your code in a separate script and send it to django shell, like this:
manage.py shell < my_script.py