https://github.com/ezhome/django-webpack-loader
For some reason when I import webpack_loader.utils like in the README.md of the repo, it only imports get_loader (I want get_static). Anyone know why might be going on here?
I have a view where I am attempting to use get_static.
from webpack_loader import utils
def app(request):
url = utils.get_static('index')['url']
print (url)
import types
from inspect import getmembers, isfunction
print ('meow')
print ([o for o in getmembers(utils) if isfunction(o[1])])
This throws an error: AttributeError: module 'webpack_loader.utils' has no attribute 'get_static'
If I comment out the url code, it shows that only get_loader is being loaded.
I'm confused as to why this is considering the file here: https://github.com/ezhome/django-webpack-loader/blob/master/webpack_loader/utils.py
In shell: http://imgur.com/a/E8BFs
Given the issue has no attention, I suggest to use pip and install the package directly from github:
$ pip install git+https://github.com/ezhome/django-webpack-loader.git
This is another way to install a third part package with pip. The command will download the sources directly from the master branch (so you've got the latest changes).
Then you can use the get_static function, e.g.
$ ./manage.py shell
Python 3.5.3 (default, Jan 29 2017, 01:40:30)
[GCC 5.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from webpack_loader import utils
>>> utils.get_static
<function get_static at 0x7f8d56bc0ea0>
UPDATE
Version 0.5.0 has been released, and presumably this issue has been fixed.
More info: https://github.com/ezhome/django-webpack-loader/issues/114