If you've ever used Python, you must be wondering why we run python manage.py shell instead of python. Both commands start the interaction interpreter, but the manage.py Shell command has an important difference: it tells Django which settings file to use before starting the interpreter. Most subsystems of the Django framework, including the template system, are dependent on the configuration file and will not work if Django does not know which configuration file to use.
If you want to know, here will explain how it works behind you. The Django Search django_settings_module environment variable, which is set in settings.py. For example, suppose MySite is in your Python search path, then django_settings_module should be set to: ' Mysite.settings '.
When you run the command: Python manage.py shell, it will automatically handle the django_settings_module for you. In the current examples, we encourage you to use the "Python manage.py shell" approach, which frees you from the hassle of configuring environment variables that you are unfamiliar with.
As you become more familiar with DJANGO, you may be inclined to discard the "manage.py shell" instead of using the "the", and manually add the django_settings_module in your config file . bash_profile this environment variable.
command to start the Python interpreter (the difference between Python manage.py shell and Python)