5

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?

Ben Davis
  • 13,112
  • 10
  • 50
  • 65

1 Answers1

3

You can use the django extentions package, which contains a shell_plus command. This command autoloads the models, but you also can use the --notebook attribute. There you can add the autoload parameter: --ext django_extensions.management.notebook_extension.

See here for more info.

Jan Willems
  • 171
  • 2
  • 11