move template to ./template;

setup django middleware;
setup angular frontend;
wire django and angular together;
This commit is contained in:
Marco Zeisler
2020-11-17 19:34:25 +01:00
parent 044a096f54
commit ff4b3508d8
97 changed files with 13737 additions and 6080 deletions
View File
+15
View File
@@ -0,0 +1,15 @@
import logging
from django.http import JsonResponse
from rest_framework.decorators import api_view
logger = logging.getLogger(__name__)
class TestApiClass:
@staticmethod
@api_view(['GET'])
def test_api(request):
logger.debug('Test api call: {}'.format(request))
return JsonResponse({'Result': 'success'}, safe=False)
+18
View File
@@ -0,0 +1,18 @@
import logging
from channels.generic.websocket import WebsocketConsumer
logger = logging.getLogger(__name__)
class CustomConsumer(WebsocketConsumer):
def connect(self):
self.accept()
def receive(self, text_data=None, bytes_data=None):
self.send('1. response: {}'.format(text_data))
self.send('2. response: {}'.format(text_data))
def disconnect(self, code):
pass