This file contains hidden or 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_import = __import__ | |
def store_loader(name, module, storage): | |
try: | |
spec = module.__spec__ | |
loader = spec.loader if type(spec.loader) == type else spec.loader.__class__ | |
except Exception as err: | |
loader = type(err) | |
module = err |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
from django.conf.urls import include | |
def decorated_include(urls, decorator) | |
"""Used to decorate all urls in a 3rd party app with a specific decorator""" | |
urls_to_decorate = include(urls) | |
for url_pattern in urls_to_decorate | |
url_pattern._callback = decorator(url_pattern._callback) |
OlderNewer