Search code examples
pythondjangodjango-manage.py

Running a plain python interpreter in presense of ipython with manage.py shell


I have ipython installed, I want to run a plain python interpreter instead with manage.py shell.

So I try,

python2.5 manage.py shell --plain

Which gave me an error, and text which suggest that --plain was passed to ipython

So I read, http://docs.djangoproject.com/en/dev/ref/django-admin/

which suggets

django-admin.py shell --plain

Which gives me

Error: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.

Which seem the correct thing for it to do.

What am I mising here? [Ubuntu Jaunty, django.VERSION = (1, 2, 0, 'alpha', 0), python 2.5 and 2.6]


Solution

  • If the reason you want to use python's interpretor over iPython's is because you need to paste the doc tests, you can try typing

    %doctest_mode
    

    in the ipython console instead

    In [1]: %doctest_mode
    *** Pasting of code with ">>>" or "..." has been enabled.
    Exception reporting mode: Plain
    Doctest mode is: ON
    >>>