Including Modified Django Package in Project

Viewed 110

I am trying to figure out how to include a modified package into a Django 2.2 project.

The package has been modified. A few skins have been added to the editor. That is, it is no longer the same package that is installed when one does pip install <package>. My understanding is that it now needs to be added to source control and probably added to the project directory, instead of being located within a virtual environment's directory.

The question is what is the way go about this situation most efficiently. Should I add the package to the project's directory or is there a way to somehow manage this through pip and requirements.txt?

1 Answers

You can push the modified library's source to a git repository and in order to install it in your projects, you can make use of PIP's VCS Support to install it via git.

For example

python -m pip install git+https://github.com/username/repository.git

requirements.txt should be something like

package-one==1.9.4
git+git://github.com/username/repository.git
package-three==1.0.1

So you don't have to keep the modified library source in the project directory, and can be installed in any project as a usual package.

Related