https://github.com/ezhome/django-webpack-cargador
Por alguna razón, cuando importo webpack_loader.utils como en README.md del repositorio, solo importa get_loader (quiero get_static). ¿Alguien sabe por qué podría estar pasando aquí?
Tengo una vista en la que intento usar 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])])Esto arroja un error: AttributeError: el módulo 'webpack_loader.utils' no tiene el atributo 'get_static'
Si comento el código de URL, muestra que solo se está cargando get_loader.
Estoy confundido sobre por qué esto está considerando el archivo aquí: https://github.com/ezhome/django-webpack-loader/blob/master/webpack_loader/utils.py
En shell: http://imgur.com/a/E8BFs
Dado que el problema no tiene atención, sugiero usar pip e instalar el paquete directamente desde github:
$ pip install git+https://github.com/ezhome/django-webpack-loader.gitEsta es otra forma de instalar un paquete de terceros con pip. El comando descargará las fuentes directamente desde la rama maestra (para que tenga los últimos cambios).
Entonces puedes usar la función get_static, por ejemplo
$ ./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>ACTUALIZAR
Se lanzó la versión 0.5.0 y, presumiblemente, este problema se solucionó.
Más información: https://github.com/ezhome/django-webpack-loader/issues/114