Make discovery API url routing more flexible / less hacky

This commit is contained in:
Mathieu Pillard 2016-05-20 14:36:39 +02:00
Родитель fe697dcbaa
Коммит 13e8ab72f7
2 изменённых файлов: 3 добавлений и 5 удалений

Просмотреть файл

@ -12,7 +12,7 @@ urlpatterns = patterns(
url(r'^v3/accounts/', include('olympia.accounts.urls')),
url(r'^v3/addons/', include('olympia.addons.api_urls')),
url(r'^v3/discovery/', include('olympia.discovery.api_urls')),
url(r'^v3/', include('olympia.discovery.api_urls')),
url(r'^v3/internal/', include('olympia.internal_tools.urls')),
url(r'^v3/', include('olympia.signing.urls')),
url(r'^v3/statistics/', include('olympia.stats.api_urls')),

Просмотреть файл

@ -4,10 +4,8 @@ from rest_framework.routers import SimpleRouter
from . import views
# Because we're registering things at "/discovery/" we don't want the trailing
# slash that comes with the Router by default.
discovery = SimpleRouter(trailing_slash=False)
discovery.register(r'', views.DiscoveryViewSet, base_name='discovery')
discovery = SimpleRouter()
discovery.register('discovery', views.DiscoveryViewSet, base_name='discovery')
urlpatterns = [
url(r'', include(discovery.urls)),