diff options
| author | Ethan Fremen | 2013-06-07 19:49:18 -0700 |
|---|---|---|
| committer | Ethan Fremen | 2013-06-07 19:49:18 -0700 |
| commit | d89aade343ba816644c393d3d073b7ddcb795947 (patch) | |
| tree | 5428050b25a1986c907bdf6006ed7014a453637d /rest_framework/routers.py | |
| parent | ae2887ffc41b1e05d6706f51b00266efccad7a58 (diff) | |
| download | django-rest-framework-d89aade343ba816644c393d3d073b7ddcb795947.tar.bz2 | |
Allow the default router to have a custom name.
Signed-off-by: Ethan Fremen <ethan@matterport.com>
Diffstat (limited to 'rest_framework/routers.py')
| -rw-r--r-- | rest_framework/routers.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rest_framework/routers.py b/rest_framework/routers.py index 9764e569..f70c2cdb 100644 --- a/rest_framework/routers.py +++ b/rest_framework/routers.py @@ -215,6 +215,7 @@ class DefaultRouter(SimpleRouter): """ include_root_view = True include_format_suffixes = True + root_view_name = 'api-root' def get_api_root_view(self): """ @@ -244,7 +245,7 @@ class DefaultRouter(SimpleRouter): urls = [] if self.include_root_view: - root_url = url(r'^$', self.get_api_root_view(), name='api-root') + root_url = url(r'^$', self.get_api_root_view(), name=self.root_view_name) urls.append(root_url) default_urls = super(DefaultRouter, self).get_urls() |
