Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid importing
django.test
package when not testing
Importing anything `rest_framework` causes `django.test` to be imported. This is because DRF registers a receiver on the `django.test_signals.setting_changed` signal. This is not really a problem, but it is good to avoid this because it bloats the memory with unnecessary modules (e.g. `django.test`, `django.core.servers.basehttp`, `socketserver`) and increases the startup time. It also doesn't feel right to import test code into non-test code. Try to import the signal from a core module if possible. Note that there's another `django.test` import in `MultiPartRenderer`, however this import is done lazily only if the functionality is used so can be easily avoided.
- Loading branch information