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

[Idea] Possibility to exclude url path, not only views #64

Open
Patataman opened this issue Apr 29, 2022 · 0 comments
Open

[Idea] Possibility to exclude url path, not only views #64

Patataman opened this issue Apr 29, 2022 · 0 comments

Comments

@Patataman
Copy link
Contributor

I wanted to use TRACK_USAGE_INCLUDE_OR_EXCLUDE_VIEWS = 'exclude' to track every view except the admin view, however it tracked too the requests for static files (which I don't want to track), creating a lot of entries in the database.

I tried to exclude it with

tracker.exclude("/static")

But when requesting static files, TrackUsage.before_request -> self.app.view_functions.get(ctx.request.endpoint)

view_func = self.app.view_functions.get(ctx.request.endpoint)
returns a lambda, which makes impossible (or at least I could find how to replicate) exclude those routes.

This could be very handy for semi-large/large applications where is faster just exclude 1 view than include all the other views.

I have seen that ctx.request.path returns the path (/, /static, /admin, etc), maybe checking both possibilities, views and routes could be a solution for this?

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

No branches or pull requests

1 participant