Search code examples
tornado

Tornado: passing parameter to static_url()


I have the following html:

<img src="{{static_url('{{DEFAULT_IMAGE}}')}}" id="xx">

I'm passing DEFAULT_IMAGE=DEFAULT_IMAGE when i call render() but it's not working. I have also tried the following:

with DEFAULT_IMAGE=static_url(..) but I guess that's the same problem. What's the correct way to passing this?


Solution

  • should be passed to render like:

    DEFAULT_IMAGE=self.static_url(DEFAULT_IMAGE)