[Django]-How do I effectively make changes to a 3rd party django app?

1👍

You can always change the code directly in site-packages/, although that requires a certain level of attention to detail to prevent shooting yourself in the foot.

Other than that you can check out the code and, from the directory containing the 3rd party package’s setup.py, do

pip install -e .

(which is similar, but better, than python setup.py develop)

This will install a link to the sources in site-packages/ so you can do the modify/test loop in the 3rd party package and run tests in your own package.

The advantage being that you’ll have VCS support for your changes.

2👍

You can modify your 3rd party app by uninstalling it using pip uninstall, then copying (or git cloning) the app into your source tree. You may need to temporarily add a line like sys.path.append("./django-leaflet") to your manage.py file so that the 3rd party modules will be in scope.

Once you are happy with your changes, you can send them to the original author as a pull request or upload your own version of the app.

Leave a comment