TokenAuthentication for rest api not working in production


Guys i have built an api with dajngo rest framework. I am using TokenAuthentication Everything works fine in local computer development mode. But when I deploy my api to server the api authentication does not work. It allows me to browse the api without any restriciton.


# How to disable admin-style browsable interface of django-rest-framework?
    # how to perform token authentication
        'rest_framework.authentication.TokenAuthentication',  # <-- And here
    # The default permission policy may be set globally, using the DEFAULT_PERMISSION_CLASSES setting.


Can you please share the code for one of your views which should be available only to those who are authenticated but which is not behaving as expected when you deploy your app.