In Django’s authentication system, every template has a user variable available, which always has an is_authenticated attribute set: the attribute is True if the user is logged in and False if they aren’t. This allows you to display one message to authenticated users and another to unauthenticated users.

