Wednesday, 1 December 2021

Import packages from outside django project

Context: The package being considered is an application that was developed by another team and I want to use the functionality exposed as part of an API call in my django project.

Directory layout:

<repo>
├── org_wide_django_code
│   ├── my_django_project
│   │   ├── my_django_project
│   │   ├── manage.py
│   │   ├── requirements.txt
│   │   └── my_application
├── frontend
│   └── application
├── other_team_work
│   ├── README.md
│   ├── __init__.py
│   ├── implemented_logic

What is the best way for me to use other_team_work in my django project my_django_project?

Prior reading:

  • Manipulating PYTHONPATH or sys.path is an option
  • Setting up a .whl or .egg to install other_team_work (also need to add a setup.py there)


from Import packages from outside django project

No comments:

Post a Comment