добавил просмотр пользователей, обновил алгоритм работы авторизации

This commit is contained in:
2024-01-12 20:33:00 +03:00
parent 7f4bdae4be
commit 09cfcdad0a
9 changed files with 135 additions and 16 deletions

View File

@@ -3,7 +3,7 @@ import os
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden
from django.shortcuts import render
# from django.db.models import Manager
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required
# только для тестирования!
import requests
@@ -11,11 +11,9 @@ import requests
TEST_BASE_FETCH = "https://test.wawaa.ru/dev-fetch.php"
@login_required
def view_index(request):
if request.user.is_authenticated:
return render(request, 'index.html')
else:
return HttpResponseRedirect('/account/login')
return render(request, 'index.html')
def view_stats(request):