Ipython 0.11 + Custom Profiles

36 views
Skip to first unread message

Chris Green

unread,
Oct 10, 2011, 7:52:25 AM10/10/11
to django-d...@googlegroups.com
I recently spent a lot of time trying to get my models automatically
imported into IPython 0.11 from the shell. command. I finally got it
working by making a new ishell command from the existing shell.py
(http://greencm.blogspot.com/2011/10/django-ipython-011-models.html).

The default django shell.py never calls the IPython Profile hooks. I
think the one patch
(https://code.djangoproject.com/attachment/ticket/14892/IPython.patch)
ran shell() rather than embed.

import IPython
IPython.embed()

That causes the default profiles to be loaded. Given that the patch
was 11 months before 0.11 final was out, it's possible the API drifted
along the way.
--
Chris Green <gre...@gmail.com>

Carl Meyer

unread,
Oct 10, 2011, 12:26:12 PM10/10/11
to django-d...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Chris,

I had the same trouble you did, only didn't pursue it very far. I don't
see any reason "manage.py shell" shouldn't support IPython profiles, and
would support a ticket/patch to this end. If it uses an IPython API
that's 0.11-only, though, it needs to have a fallback to still support
0.10 as well.

Carl
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6THKQACgkQ8W4rlRKtE2c8/ACgmMdvnesM4X1zZlcoDw+/TDtt
2qIAn19W0bExqZE/AWhVnJJVQLQqARsi
=/vI5
-----END PGP SIGNATURE-----

Reply all
Reply to author
Forward
0 new messages