HowTo access flask_assets.Bundle.urls from yaml?
ramschmaerchen opened this issue · comments
ramsch commented
How do I access Bundle.urls when using from_yaml?
The following works but I can not access urls
when registered via a yaml file.
registered in code works:
test = Bundle('scss/test.scss', filters="pyscss", output='compiled/test.css')
assets.register("test", test)
print(test.urls())
# Output
/static/compiled/test.css?68b329da
registered in yaml does not:
test:
filters: pyscss
output: compiled/test.css
contents:
- scss/test.scss
assets.from_yaml("static/assets.yaml")
print(test.urls())
# Output
NameError: name 'test' is not defined
Michael commented
You will need to do something like assets['test'].urls()