if not authenticated redirect django code example
Example 1: django login required decorator
from django.contrib.auth.decorators import login_required
@login_required
def my_view(request):
...
Example 2: how to create staff account in django
user = User.objects.create_user('john', '[email protected]', 'johnpassword')
user.is_staff=True
user.save()
Example 3: login system in django
LOGOUT_REDIRECT_URL = 'your_url'