I want to make the following ipython commands permanent when using django shell:
%load_ext autoreload
%autoreload 2
Unfortunately, Django doesn’t seem to use my global ipython config, so putting them in my default_profile doesn’t seem to work. Is there any way to have these executed automatically when running django shell?
You can use the django extentions package, which contains a
shell_pluscommand. This command autoloads the models, but you also can use the--notebookattribute. There you can add the autoload parameter:--ext django_extensions.management.notebook_extension.See here for more info.