Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

192
Views
¿Importar no importar todas las funciones?

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

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

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.git

Esta 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

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!