Not sure I agree with the other answer.
Python has a built in function reload()
which, from the docs:
Reload a previously imported module. The argument must be a module object, so it must have been successfully imported before.
This is useful if you have edited the module source file using an external editor and want to try out the new version without leaving the Python interpreter. The return value is the module object (the same as the module argument).
However you have to do from polls import models
and then models.Poll
(as it has to be passed the actual module rather than a class) and models.Choice
in your code.
That way, without leaving the shell you can run reload(models)
.
Edit 1:
If you can't be bothered typing models.
all the time, you can also enter in your own shortcut;
from polls import models as pm
pm.Poll
pm.Choice
reload(pm)