Logout link giving error 405

The tutorial is obsolete.

See the thread and related links at Showing `Method Not Allowed (GET): /users/logout/`

Instead of trying to learn Django from some random YouTube videos, I suggest you work your way through the Official Django Tutorial and the Django Girls Tutorial, and then find additional resources at GitHub - wsvincent/awesome-django: A curated list of awesome things related to Django