H
H
Held69912021-09-08 03:10:50
Django
Held6991, 2021-09-08 03:10:50

How to prevent access to a specific link by everyone except the Django server?

Hello, I have an API, which I would like to be able to access only the server itself when it performs any actions, but a normal user does not, how to do this?

class FlatsViewSet(viewsets.ModelViewSet):
    permission_classes = [IsAdminUser]

I tried this, a normal user cannot use the functionality that is used on the site when accessing the API

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question