-
Notifications
You must be signed in to change notification settings - Fork 343
Add dynamic loader class support #202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
via `LOADER_CLASS` config option
Add support for dynamic loader classes
Also adds a test to ensure caching is working.
Fix name error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Looks good. Added some comments.
try: | ||
urlpatterns.append(url(r'^admin/', include(admin.site.urls))) | ||
except ImproperlyConfigured: | ||
urlpatterns.append(url(r'^admin/', admin.site.urls)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this for Django backward compatibility? I'd suggest to import django, check the version and have an if -else clause based on the version to make it obvious for the reader.
|
||
|
||
class WebpackLoader(object): | ||
_assets = {} | ||
|
||
def __init__(self, name='DEFAULT'): | ||
def __init__(self, config, name='DEFAULT'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be remove the default param as we always explicitly pass the config now.
django111: django>=1.11.0,<2.0 | ||
django22: django>=2.2.0,<2.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also support 2.1 and 2.0 explicitly.
I suppose this is not needed anymore now that we've merged another PR that implemented custom load classes? |
Also drops support for older versions of Python/Django, and introduces support for newer ones. Those changes may or may not be acceptable here, but I wanted to open this for an example of the dynamic loader class support, which we're using to load the stats file via
staticfiles_storage.open()
.