[Answered ]-Django: need to modify view in installed package

2👍

It won’t do you any good modifying the package. Instead, you should subclass the view and override the methods you need to behave differently.

from ckeditor_uploader import ImageUploadView

class MyCustomView(ImageUploadView):
    def post(self, request, **kwargs):
        # do something different here,
        # then hand things over to 
        # the original parent
        return super(MyCustomView, self).post(request, **kwargs)

Leave a comment