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

API versions and throttling #20

Open
un33k opened this issue Jun 16, 2014 · 3 comments
Open

API versions and throttling #20

un33k opened this issue Jun 16, 2014 · 3 comments
Labels

Comments

@un33k
Copy link

un33k commented Jun 16, 2014

Not sure if you plan to add support for api version and throttling. However, I'd be really interested in your opinion on the subject and your recommendation for restless-based projects.

@joshfriend
Copy link

@un33k If you are using Flask, using Blueprints is a good way to add an api version number at the beginning of all your endpoint URLs.

@un33k
Copy link
Author

un33k commented Sep 23, 2014

@joshfriend. I use Django and for now, I just name the API app, v1 and later on copy app and name it v2,v3 etc. and they all can co-exist. It works and easier to maintain, but lot of duplicate code.

@toastdriven
Copy link
Owner

Right now, there's no plans to add either. In Django, you should be able to achieve this via your URLconf (r('v1/whatever/', include(WhateverResource.urls())),). You should also be able to prevent a lot of duplication by simply subclassing your (previous version) resources, rather than copying everything.

As for throttling, I waffle. The real problem is that you need a persistent data store to track it & everyone has a different opinion about where they want to store that data (flat file, SQL DB, Redis, memcached, etc.) and as such, that Restless can't lean on most any specific abstraction. Lastly, it could really just be a set of decorators created as a separate library that you decorate your methods with.

However, docs on both of these things would be a good thing, so I'll add that to the TODO list.

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

No branches or pull requests

3 participants