Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registering resources using add_url_rule() does not automatically prefix urls #12

Open
mikeywaites opened this issue Feb 10, 2018 · 0 comments
Assignees

Comments

@mikeywaites
Copy link
Owner

mikeywaites commented Feb 10, 2018

In some cases we might wan't to manually mount handlers to urls using the standard functionality provided by the flask Blueprint object.

For example, flask-oauthlib provides a view that handles the OAuth authentication flow. It's a little confusing to the user that the normal url_prefixing that occurs when mounting resources does not occur when using the lower level blueprint methods.

Manually Mounting Views on Resources

oauth_resource = Resource('api_v3.authentiation', __name__, url_prefix='/oauth')
oauth_resource.add_url_rule('/authorization', view_func=authorize, methods=['GET'])

Currently this would result in the authorize func being mounted on the url /authorize and not /v3/oauth/authorize as you might expect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant