v0.0.00.5
This commit is contained in:
parent
36aacf8189
commit
b5002006d0
@ -61,8 +61,11 @@ MIDDLEWARE = [
|
||||
|
||||
]
|
||||
|
||||
LOGIN_URL = '/streaming/login/'
|
||||
LOGIN_REDIRECT_URL = '/streaming/'
|
||||
LOGIN_URL = '/liquid/login/'
|
||||
|
||||
LOGIN_REDIRECT_URL = '/liquid/streaming/'
|
||||
|
||||
LOGOUT_REDIRECT_URL = '/liquid/login/'
|
||||
|
||||
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
|
||||
|
||||
|
||||
@ -16,14 +16,9 @@ Including another URLconf
|
||||
"""
|
||||
from django.contrib import admin
|
||||
from django.urls import path, include
|
||||
from django.contrib.auth import views as auth_views
|
||||
from django.contrib.auth import views
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
# path('accounts/', include('django.contrib.auth.urls')),
|
||||
# path('login/', auth_views.LoginView.as_view(template_name='registration/login.html'), name='login'),
|
||||
# path('logout/', auth_views.LogoutView.as_view(next_page='/login/'), name='logout'),
|
||||
# path('admin/', admin.site.urls),
|
||||
# path('login/', include("streaming.urls")),
|
||||
path('streaming/', include("streaming.urls"))
|
||||
path('streaming/', include("streaming.urls")),
|
||||
]
|
||||
|
||||
@ -4,5 +4,5 @@ from . import views
|
||||
urlpatterns = [
|
||||
path('login/', views.login_view, name='login'),
|
||||
path('logout/', views.logout_view, name='logout'),
|
||||
path('', views.stream_view, name='stream'),
|
||||
path('', views.stream_view, name='stream'),
|
||||
]
|
||||
@ -5,15 +5,6 @@ from django.contrib.auth import authenticate, login, logout
|
||||
from django.views.decorators.csrf import csrf_protect
|
||||
from django.contrib.auth.decorators import login_required
|
||||
|
||||
@login_required
|
||||
def stream_view(request):
|
||||
history = DetectionHistory.objects.all()[:20]
|
||||
return render(request, 'streaming/stream.html',{
|
||||
"websocket_url": settings.WEBSOCKET_URL,
|
||||
"history": history
|
||||
})
|
||||
|
||||
|
||||
@csrf_protect
|
||||
def login_view(request):
|
||||
if request.method == 'POST':
|
||||
@ -31,6 +22,14 @@ def logout_view(request):
|
||||
logout(request)
|
||||
return redirect('login')
|
||||
|
||||
@login_required
|
||||
def stream_view(request):
|
||||
history = DetectionHistory.objects.all()[:20]
|
||||
return render(request, 'streaming/stream.html',{
|
||||
"websocket_url": settings.WEBSOCKET_URL,
|
||||
"history": history
|
||||
})
|
||||
|
||||
# @login_required
|
||||
# def home_view(request):
|
||||
# return render(request, 'streaming/stream.html')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user