DEV Community

Discussion on: Adding Authentication to a REST Framework Django API

Collapse
 
aliplutus profile image
aliplutus

I know how to make a modle that only authenticated users can do GET req for it, but how to make a modle and a view where only the users who creatrd it can make GET req to it or the users that i dpesify

Collapse
 
nobleobioma profile image
Noble Obioma

You can create a middleware. These are python classes that hooks into the request/response life cycle and are processed upon every request/response your Django application handles. In then you can have the logic which ascertains that the request made meets the requirements in order to receive a response.