Unable to find the Python module execute_manager in django.core.management

django

Problem: to find the Python module execute_manager in the class django.core.management.

The question is related to another question of mine.

I am trying to start my server by

python manage.py runserver

The command is dependent on manage.py.
The file imports the module execute_manager from the class django.core.management as follows

from django.core.management import execute_manager

I have tried to find the source code of the module unsuccessfully in the django installation folder by

$find . | grep exe
./django/core/management/commands/sqlindexes.py

Similarly, I get the following results by ack.

django/conf/project_template/manage.py
2:from django.core.management import execute_manager
11:    execute_manager(settings)

django/core/management/__init__.py
333:def execute_manager(settings_mod, argv=None):

examples/manage.py
2:from django.core.management import execute_manager
11:    execute_manager(settings)

How can you find the source code of the module execute_manager in the class django.core.management?

Best Solution

execute_manager is a function, not a module, defined in the __init__.py file in the django.core.management package. That is why your grep failed to find it.

Your ack found it with this result that you pasted:

django/core/management/__init__.py
333:def execute_manager(settings_mod, argv=None):
Related Question