﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
18204	manage.py shell w/ IPython embed does not work well	liokm	nobody	"#17078 introduced the usage of `IPython.embed()`. This also introduced the bug described in the bottom part of https://github.com/ipython/ipython/issues/62 to the IPython shell opened by Django. For example:

{{{
    >>> def foo():
    ...     print foo
    >>> foo()
    ...
    NameError: global name 'foo' is not defined
}}}
The issue https://github.com/ipython/ipython/issues/62 just solved for normal IPython shell, not for `embed` calling from function, which is used in current Django, as in django/core/management/commands/shell.py
{{{
    def ipython(self):
        ...
            from IPython import embed
            embed()
        ...
}}}
Some quotes of takluyver from IPython team in the github link above

    It's possible for Django to start IPython in a way that won't cause this problem, but that's not the way we currently make easy. The problem occurs when IPython starts with separate local and global namespaces. There's no reason that Django requires separate local and global namespaces, but that's what calling embed() inside a function implies.

My env: Django 1.4 and 1.5 alpha w/ IPython 0.12 and 0.12.1
"	Bug	closed	Core (Management commands)	1.4	Normal	duplicate			Accepted	1	0	0	1	0	0
