DEV Community

loading...

Discussion on: help creating django REST API

Collapse
ziggo profile image
Giuseppe

I just think that, if you use django-rest-framework, according to the example in django-rest-framework.org/#quickstart, you should define into the class:
class MyTypeViewSet(viewsets.ModelViewSet)

Instead of: queryset = MyType.objects.all()
Something like: queryset = requests.get('yourApi1.com/mytype').text

Maybe you will have to parse the data, or something like that about the formatting of the data, I don't remember right now, I haven't used django-rest for a while

Collapse
alifarhad profile image
Farhad Ali Author

hi thanks for your reply. actually I searched few things, and so far it looks like I might not need to use DRF at all. it should be doable with Django itself.