Django Shell Problem

I am new to Django, so I have one issue following the tutorials. When I write python manage.py shell instead of the regular shell, it gives me some ipython shell that starts with: In [1]: …
What is the problem?

It’s not a problem. Enjoy all the goodness that ipython provides!

Is your environment already set up to use ipython? If so, then I’m pretty sure that manage.py will use it as well. (I generally set up my environments to use ipython - it has a lot of advantages over the regular shell, including command history across sessions.)

Thanks for your response, but when I want to import models and “play” with the database it says incorrect syntax. I just want the regular shell. Any idea how can I switch to regular shell ?

if you are having a syntax error, it’s not caused by ipython. Switching back to the regular shell is only going to give you the same errors.

Can you please show a snippet of what you’re trying to do? (Also, providing more detail about the models themselves, along with your settings file, may be very helpful to determine the root cause of the issue you’re facing.)

Also, I do suggest that you install and configure the django_extensions package. It provides the “shell_plus” command which pre-imports all your models so that you don’t need to.

Hey Ken, I’m getting the same issue. I’m trying to follow this tutorial from Django’s documentation: https://docs.djangoproject.com/en/3.0/intro/tutorial02/

I imagine this user is trying to accomplish the same thing. When I execute this cli statement, I’m expecting the database api to be displayed in my terminal. Am I misunderstanding the tutorial or is this what should be displayed? If it is, how do I get it displayed?

Nvm, I should have realized the “output” I was referring to were actually inputs.

Quite alright, and that’s why I ask for people to post captures showing exactly what they’ve entered and the responses they’re getting. If they’re not used to the “>>>” notation in the examples, it becomes obvious really quickly, and someone can address that easily.

To answer a question from further up the thread, you can pick which interpreter you want via the -i option:

python manage.py shell -i python

This will give you a plain python interpreter even if you have other ones installed (Django will look for ipython and bpython by default).
There’s more information in the documentation for manage.py shell: https://docs.djangoproject.com/en/stable/ref/django-admin/#shell