Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Metagenomics
metagenedb
Commits
db3e5157
Commit
db3e5157
authored
Nov 14, 2019
by
Kenzo-Hugo Hillion
♻
Browse files
Start testing new view for external requests
parent
9f1dd1ac
Changes
5
Hide whitespace changes
Inline
Side-by-side
backend/metagenedb/api/external/__init__.py
0 → 100644
View file @
db3e5157
backend/metagenedb/api/external/urls.py
0 → 100644
View file @
db3e5157
from
django.conf.urls
import
url
from
metagenedb.api.external.views.togows
import
ListUsers
urlpatterns
=
[
url
(
r
'^togows/$'
,
ListUsers
.
as_view
()),
]
backend/metagenedb/api/external/views/__init__.py
0 → 100644
View file @
db3e5157
backend/metagenedb/api/external/views/togows.py
0 → 100644
View file @
db3e5157
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
)
backend/metagenedb/api/urls.py
View file @
db3e5157
...
...
@@ -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'
)))
]
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment