Saturday, August 27, 2011

Re: ipython 0.11 with django 1.3 /in virtualenv

Hi Shawn,

On 08/28/2011 02:49 AM, Shawn Milochik wrote:
> If iPython is installed it should be used automatically in Django's
> manage.py shell.
>
Apologies. I think I didn't express myself well enough.
ipython is being used bydjango.

What I just don't understand is why ipython does not import my
customisations if called via './manage.py shell'?

What I wanted to do is configuring ipython such, that it imports already
some of my application libraries when starting the shell.

This would accelerate my debugging activities.


With older versions of ipython Imanaged to do this via some code in
ipythonrc.

However since ipython 0.11 the way, that once customizes iptyhon has
changed.

Now I have to some python files like
~/.config/ipython/profile_default/ipython_config.py,
which seem to be loaded when running ipython,
but which don't seem to be loaded when running ./manage.py shell

> If it's not working and works when you run iPython directly, the most
> likely case is that you're running two different Python environments and
> one has iPython installed and the other doesn't.

I have two different ipython versions on my system:
an older one installed by my distro
and 0.11 in the same virtualenv in which I installed django.

I am rather sure though, that ./manage.py shell picks up the correct one.

If I type
dir()
in ipython, then I see the symbol 'get_ipython' which does not exist in
my old ipython version.


>
> You mention virtualenv in the subject line but not in the question. Try
> running 'pip install ipython' in your virtualenv.
>
>
Yes I mentioned it in the title just in case.
I am rather sure though, that I pick up the correct ipython version

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment