Register URL routes for Flask application or blueprint in lazy way
Consider the following route: ``` python @app.route('/users/', defaults={'page': 1}) @app.route('/users/page/<int:page>') def show_users(page): pass ``` Defining this as lazy view does not work as it throws the following error: ``` python lazy_views.add('/users', 'show_users', defaults={'page': 1}) lazy_views.add('/users/page/<int:page>', 'show_users') ``` ``` AssertionError: View function mapping is overwriting an existing endpoint function: show_users ``` I used the following workaround for this issue: ``` python show_users_view = lazy_views.get_view('show_users') lazy_views.add('/users', show_users_view, defaults={'page': 1}) lazy_views.add('/users/page/<int:page>', show_users_view) ``` Thanks for this great component. We've been using LazyViews on a big Flask application.
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be resolved. The issue was opened by kvesteri and has received 3 comments.