You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got the package working with all setup in place, The API to save information is called and executed successfully. The only problem right now is that the user information is not saved. My findings say that this is because I am using DRF. The way DRF injects a user into the request is may be different from how the traditional Django does. And hence the request.user in the view of the package in not found.
Right now i am thinking to make a clone of the repo and make changes directly in order to debug and find the exact issue/solution.
Kindly let me know what would be the right way. Or is there is a existing solution to this already.
Thanks
The text was updated successfully, but these errors were encountered:
The given package safwanrahman/django-webpush is not compatible with Django rest framework, As the package core classes in view use the post and http methods from the django core classes, Which cannot find the user if you have changed the authentication middleware while using DRF.
The solution to that is to import the package folder and make changes in the view such that the view function being called is inherited from the DRF core classes and hence fourth able to find the logged in user in the request object. I am still trying to understand if somehow only that class can be extended and changed. But for now this solution works for me.
Hi,
I am using using Django Rest Rramework.
I got the package working with all setup in place, The API to save information is called and executed successfully. The only problem right now is that the user information is not saved. My findings say that this is because I am using DRF. The way DRF injects a user into the request is may be different from how the traditional Django does. And hence the
request.user
in the view of the package in not found.Right now i am thinking to make a clone of the repo and make changes directly in order to debug and find the exact issue/solution.
Kindly let me know what would be the right way. Or is there is a existing solution to this already.
Thanks
The text was updated successfully, but these errors were encountered: