v0.0.00.5

This commit is contained in:
r0mchik 2025-06-05 16:46:48 +07:00
parent df69a89ed7
commit 7932717980
3 changed files with 8 additions and 7 deletions

View File

@ -3,10 +3,11 @@ from django.shortcuts import redirect
import re
EXEMPT_URLS = [
re.compile(settings.LOGIN_URL.lstrip('/')), # eg. '^login/$'
re.compile(settings.LOGIN_URL.lstrip('/')), # eg. 'streaming/login/'
re.compile(r'^admin/login/$'), # админ-логин
re.compile(r'^static/'), # статика
re.compile(r'^media/'), # медиаконтент
re.compile(r'^liquid/login/$'), # <-- добавь это!
re.compile(r'^static/'),
re.compile(r'^media/'),
]
class LoginRequiredMiddleware:

View File

@ -87,7 +87,7 @@ TEMPLATES = [
CSRF_COOKIE_SECURE = False
SESSION_COOKIE_SECURE = False
CSRF_TRUSTED_ORIGINS = ['http://192.168.0.169:8106']
CSRF_TRUSTED_ORIGINS = ['http://192.168.0.169']
WSGI_APPLICATION = 'app.wsgi.application'

View File

@ -15,8 +15,8 @@ def login_view(request):
login(request, user)
return redirect('stream')
else:
return render(request, 'login.html', {'error': 'Неверный логин или пароль'})
return render(request, 'login.html')
return render(request, 'templates/login.html', {'error': 'Неверный логин или пароль'})
return render(request, 'templates/login.html')
def logout_view(request):
logout(request)
@ -25,7 +25,7 @@ def logout_view(request):
@login_required
def stream_view(request):
history = DetectionHistory.objects.all()[:20]
return render(request, 'streaming/stream.html',{
return render(request, 'templates/streaming/stream.html',{
"websocket_url": settings.WEBSOCKET_URL,
"history": history
})