문제

I have an app included into INSTALLED_APPS that needs to be monkey-patched. The problem is that I don't explicitly import modules from this app (django-allauth).

Is there any way to get some access at the point when Django imports an application and monkey patch one of it's internal forms?

Which in my case would be socialaccount.forms.DisconnectForm.clean = smth

도움이 되었습니까?

해결책

The solution here was to copy the package to my application folder and patch it locally.

다른 팁

import ipdb; ipdb.set_trace() in the __init__ of the module. And write the char "w" to see the trace

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top