How do you reload a Django model module using the interactive interpreter via “manage.py shell”?

前端 未结 9 1086
广开言路
广开言路 2020-11-28 02:14

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

9条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-28 02:54

    You can also use django-extensions project with the following command:

    manage.py shell_plus --notebook
    

    This will open a IPython notebook on your web browser instead of the IPython shell interpreter. Write your code there, and run it.

    When you change your modules, just click on the web page menu item 'Kernel->Restart'

    Re-running the code now uses your modified modules.

提交回复
热议问题