Hacker News new | ask | show | jobs
by matsemann 1000 days ago
In django you're importing a default cache, a default storage etc, and write your code to the interface. In settings.py you wire it all up. It's basically the same, for testing you would have to mock the import or provide some implementation.
1 comments

technically that's not dependency injection, but a global service locator.
Yeah I agree on that here.

The user doesn't write DI code for Django Class Based views. E.g. the view doesn't accept a Database upon instantiation.