praktikum Aufgabe9
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
import django_eventstream
|
||||
from channels.auth import AuthMiddlewareStack
|
||||
from channels.http import AsgiHandler
|
||||
from channels.routing import URLRouter, ProtocolTypeRouter
|
||||
from django.urls import re_path
|
||||
|
||||
urlpatterns = [
|
||||
re_path(r'^events/',
|
||||
AuthMiddlewareStack(URLRouter(django_eventstream.routing.urlpatterns)),
|
||||
{'channels':['notice']}),
|
||||
re_path(r'',AsgiHandler)
|
||||
]
|
||||
|
||||
application = ProtocolTypeRouter({
|
||||
'http': URLRouter(urlpatterns)
|
||||
})
|
||||
@@ -3,8 +3,6 @@
|
||||
|
||||
<h2>Seite Infos</h2>
|
||||
|
||||
|
||||
|
||||
<div class="card w-100">
|
||||
<div class="card-body jumbotron" style="background: ghostwhite">
|
||||
{% for notice in allnotice %}
|
||||
@@ -24,9 +22,3 @@
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
<style>
|
||||
.test{
|
||||
background-color: darkgray;
|
||||
}
|
||||
</style>
|
||||
@@ -49,6 +49,7 @@ def delete(request, deleteId = None):
|
||||
delNotice = Notice.objects.get(id=deleteId)
|
||||
if delNotice != None:
|
||||
delNotice.delete()
|
||||
send_event('notice', 'message', deleteId)
|
||||
return redirect('index')
|
||||
|
||||
@csrf_exempt
|
||||
|
||||
Reference in New Issue
Block a user