[Django]-Difference between interactive Python console and Django's "manage.py shell"

8đź‘Ť

âś…

Directly typing python, just starts the interpreter.

Using manage.py within a django project sets the environment so that you can interact with your project objects in the shell. As noted here:

We’re using this instead of simply typing “python”, because manage.py
sets the DJANGO_SETTINGS_MODULE environment variable, which gives
Django the Python import path to your mysite/settings.py file.

Leave a comment