Question

I have been using an app called django-easy-friends in my application.

Now problem i want to make some changes in the app installed. I want to make entries in a different table each time a new friend is added.

Now my question is, is it wise to change the code in installed apps? If not how else to customise the apps to be installed?

Was it helpful?

Solution

I don't like to modify code in third party libraries. If you find a bug, you rather fork the library, fix it, make a pull request and update it into your INSTALLED_APPS.

If you want to do some modifications to get different behavior, I think is wiser to subclass the class you want to modify, encapsulate it, monkey patch it, or whatever object oriented methodology you find suitable for the modification you want to make.

The problems with modifying code in third party libraries come to light when you want to update the third party library. You'll get all sort of errors when you do it. Because your changes would've pass unknown to the library makers and if for some reason you forget what the changes were, your app will become a real mess.

IMHO, you should not modify a third party library. Instead, proceed as recommended above, report a bug, subclass their classes, etc, but don't modify it!

Hope this helps!

OTHER TIPS

I think you should be fine, as long as you stay away from editing your models, all you are going to do is change 'the way your app works'. If you do edit your models you may have to remove the database and re-sync it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top