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
Thanks. This is a great suggestion. I will be adding a new "up/down vote" sample code and will use this approach in that code right away. And then when I can re-record lectures I will move this into the favs code.
In the favs app -
The views 'AddFavoriteView' and 'DeleteFavoriteView', use in the 'csrf_exempt' decorator, because we want to allow non-secure access, but I found a way to use csrf token for them.
As can you see here:
views.py: https://github.com/LiorA1/Django/blob/main/dj4e-samples/favs/views.py#L79
I Solved it, by adding 'csrf_token' in the 'list.html' template:
https://github.com/LiorA1/Django/blob/main/dj4e-samples/favs/templates/favs/list.html#L68
The text was updated successfully, but these errors were encountered: