Skip to content

Instantly share code, notes, and snippets.

@saurabh-hirani
Last active December 19, 2015 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saurabh-hirani/5990909 to your computer and use it in GitHub Desktop.
Save saurabh-hirani/5990909 to your computer and use it in GitHub Desktop.
def add_url_rule(self, rule, endpoint=None, view_func=None, **options):
"""Connects a URL rule. Works exactly like the :meth:`route`
decorator. If a view_func is provided it will be registered with the
endpoint.
Basically this example::
@app.route('/')
def index():
pass
Is equivalent to the following::
def index():
pass
app.add_url_rule('/', 'index', index)
If the view_func is not provided you will need to connect the endpoint
to a view function like so::
app.view_functions['index'] = index
.....
.....
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment