5

I'm trying to port a simple flask app to sanic, working with the example for sanic and jinja.

Does sanic have a url_for() function like flask?

Udi
  • 29,222
  • 9
  • 96
  • 129
user666
  • 5,231
  • 2
  • 26
  • 35

2 Answers2

8

Update: Sanic 0.3.1 adds support for url_for():

url = app.url_for('post_handler', post_id=5, arg_one='one', arg_two='two')

No. Currently sanic's router is very basic and does not support lookups. You can review the short source code here: https://github.com/channelcat/sanic/blob/master/sanic/router.py

Udi
  • 29,222
  • 9
  • 96
  • 129
2

Now the sanic support url_for method

resource code

agnewee
  • 100
  • 7