This isn't a complete answer but hopefully it'll make a sensible starting point.
From what I can tell, the dependencies of a django project (apart from django itself and its dependencies*
) consists of:
- Modules imported by your django project
- Apps loaded by your project via
settings.INSTALLED_APPS
(and their dependencies)
#1 Modules imported by your project
You can probably discover this using snakefood.
#2 Apps loaded via settings.INSTALLED_APPS
Running the following script should give the path to apps listed in INSTALLED_APPS
:
#!/usr/bin/env python
from settings import INSTALLED_APPS
from django.utils.importlib import import_module
import os
app_names = (x for x in INSTALLED_APPS if not x.startswith('django'))
app_paths = (os.path.dirname(os.path.abspath(import_module(x).__file__)) for x in app_names)
print "\n".join(x for x in app_paths if not x.startswith(os.getcwd()))
You can then pass this on to snakefood
to discover their dependencies.
*
To be thorough, it should be possible to discover the various backends (db/cache/auth/etc.) from settings
and include the associated modules into your list of dependencies.