-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for additional kwargs in middlewares
- Loading branch information
Diego Navarro Mellén
committed
Oct 7, 2020
1 parent
8028228
commit b13d72e
Showing
2 changed files
with
19 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
from django.utils.module_loading import import_string | ||
|
||
|
||
def load_middleware(path_or_obj): | ||
def load_middleware(path_or_obj, **kwargs): | ||
if isinstance(path_or_obj, str): | ||
return import_string(path_or_obj)() | ||
return import_string(path_or_obj)(**kwargs) | ||
return path_or_obj |