added simple navigation to switch from images to map view;

added simple images view skeleton;
remove unnecessary websocket support;
This commit is contained in:
Marco Zeisler
2021-01-11 18:53:12 +01:00
parent 91161247e8
commit e2a09b465d
16 changed files with 184 additions and 65 deletions
-17
View File
@@ -1,17 +0,0 @@
from django.conf.urls import url
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.sessions import SessionMiddlewareStack
from django.core.asgi import get_asgi_application
from .views.ws_api import CustomConsumer
application = ProtocolTypeRouter({
# Django's ASGI application to handle traditional HTTP requests
"http": get_asgi_application(),
# WebSocket send handler
"websocket": SessionMiddlewareStack(URLRouter([
url(r"^test-ws-endpoint/$", CustomConsumer.as_asgi()),
]))
})
-4
View File
@@ -8,9 +8,6 @@ https://docs.djangoproject.com/en/2.0/ref/settings/
import datetime
import os
# set the websocket routing module location here
ASGI_APPLICATION = 'app_be.routing.application'
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
@@ -34,7 +31,6 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'channels',
'rest_framework',
]
-1
View File
@@ -22,7 +22,6 @@ from app_be.views.rest_api import TestApiClass, ImageEndpoint, HealthEndpoint
urlpatterns = [
path('admin/', admin.site.urls),
url(r'^test/', TestApiClass.test_api),
url(r'^image/get/all$', ImageEndpoint.image_api_get_all),
url(r'^image/get/(?P<identifier>[\w-]+)$', ImageEndpoint.image_api_get_single),
url(r'^image/get/(?P<identifier>[\w-]+)/version/(?P<version>[\w-]+)$', ImageEndpoint.image_api_get_single_version),
-18
View File
@@ -1,18 +0,0 @@
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