These are chat archives for django/django
getif there is a chance that you will get an exception? Why not use filter and check with
saveand yes you can do it in one line
Greetings! I have a question:
I have a frontend app on Vue.js and a backend app on Django + Django REST Framework.
I am trying to make authentication using django-rest-auth.
However, the CSRF Token doesn't save in cookies.
When I try to connect to /rest-auth/user after authorization, I get an error: "detail": "Credentials were not provided."
Could you kindly advise on what I should do in this case?
try: update_help = Proof.objects.get(user_id=request.user.user_id) except Proof.DoesNotExist: raise Http404
get_object_or_404which replaces this statement. You can import it from
from django.shortcuts import get_object_or_404