добавил просмотр пользователей, обновил алгоритм работы авторизации
This commit is contained in:
@@ -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):
|
||||
|
Reference in New Issue
Block a user