7👍
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.
7👍
Maybe this is useful, in case the project used ‘pip’ to install the dependencies/libraries:
pip freeze
- Why am I unable to run django migrations via the 'docker-compose run web' command?
- Django 'ascii' codec can't encode character
3👍
run this command inside your django project, this will write all the installed packages inside requirements.txt file
pip freeze > requirements.txt
or if you are using python3 then use pip3 like this
pip3 freeze > requirements.txt
you will find the requirements.txt file inside your django project
2👍
- How would I override the perform_destroy method in django rest framework?
- Linking django and mysql containers using docker-compose
- Can't Create Super User Django
- Django Storages – Could Not Load Amazon's S3 Bindings Errors
- Django: how to change values for nullbooleanfield in a modelform?