diff options
| author | Tom Christie | 2014-11-25 16:27:00 +0000 |
|---|---|---|
| committer | Tom Christie | 2014-11-25 16:27:00 +0000 |
| commit | f13c0ebe69f92ecad7e84257b3baf2ccafe69b3e (patch) | |
| tree | 5de4f2bcbd973513197c809b301f05f21b9db325 /docs/api-guide/throttling.md | |
| parent | 8c91e7b742067b6d4e4ed6d476bfe2cf5839ac8b (diff) | |
| parent | b733f85ff1e3f70e9f5dee6f52bebe861bc0f411 (diff) | |
| download | django-rest-framework-f13c0ebe69f92ecad7e84257b3baf2ccafe69b3e.tar.bz2 | |
Merge master
Diffstat (limited to 'docs/api-guide/throttling.md')
| -rw-r--r-- | docs/api-guide/throttling.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/api-guide/throttling.md b/docs/api-guide/throttling.md index 147c16ff..3f668867 100644 --- a/docs/api-guide/throttling.md +++ b/docs/api-guide/throttling.md @@ -1,4 +1,4 @@ -<a class="github" href="throttling.py"></a> +source: throttling.py # Throttling @@ -83,7 +83,7 @@ The throttle classes provided by REST framework use Django's cache backend. You If you need to use a cache other than `'default'`, you can do so by creating a custom throttle class and setting the `cache` attribute. For example: class CustomAnonRateThrottle(AnonRateThrottle): - cache = get_cache('alternate') + cache = get_cache('alternate') You'll need to remember to also set your custom throttle class in the `'DEFAULT_THROTTLE_CLASSES'` settings key, or using the `throttle_classes` view attribute. @@ -147,15 +147,15 @@ For example, given the following views... class ContactListView(APIView): throttle_scope = 'contacts' ... - + class ContactDetailView(ApiView): throttle_scope = 'contacts' ... - class UploadView(APIView): + class UploadView(APIView): throttle_scope = 'uploads' ... - + ...and the following settings. REST_FRAMEWORK = { |
