Commit db3e5157 authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

Start testing new view for external requests

parent 9f1dd1ac
from django.conf.urls import url
from metagenedb.api.external.views.togows import ListUsers
urlpatterns = [
url(r'^togows/$', ListUsers.as_view()),
from rest_framework.views import APIView
from rest_framework.response import Response
from django.contrib.auth.models import User
class ListUsers(APIView):
View to list all users in the system.
def get(self, request, format=None):
Return a list of all users.
usernames = [user.username for user in User.objects.all()]
return Response(usernames)
......@@ -3,5 +3,6 @@ from django.urls import include, path
urlpatterns = [
path('auth/', include(('metagenedb.api.accounts.urls', 'auth'))),
path('catalog/', include(('metagenedb.api.catalog.urls', 'catalog')))
path('catalog/', include(('metagenedb.api.catalog.urls', 'catalog'))),
path('external/', include(('metagenedb.api.external.urls', 'external')))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment