fix a few bugs with the liveview
This commit is contained in:
@@ -23,6 +23,16 @@ server {
|
||||
alias /usr/src/app/media;
|
||||
}
|
||||
|
||||
location /ws/ {
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_pass http://app_server;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
@@ -87,6 +87,16 @@ server {
|
||||
proxy_redirect http://reporter:5129/ /reporter/;
|
||||
}
|
||||
|
||||
location /ws/ {
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_pass http://app_server;
|
||||
}
|
||||
|
||||
# Default proxy to the Django/gunicorn upstream
|
||||
location / {
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
@@ -124,6 +134,16 @@ server {
|
||||
location /static/ { alias /usr/src/app/static/; }
|
||||
location /media { alias /usr/src/app/media; }
|
||||
|
||||
location /ws/ {
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_pass http://app_server;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
+3
-3
@@ -323,7 +323,7 @@ class SeriesImageBase(models.Model):
|
||||
try:
|
||||
with pydicom.dcmread(self.image) as d:
|
||||
return d
|
||||
except pydicom.errors.InvalidDicomError:
|
||||
except (pydicom.errors.InvalidDicomError, FileNotFoundError, OSError):
|
||||
return {}
|
||||
|
||||
def get_full_url(self):
|
||||
@@ -335,14 +335,14 @@ class SeriesImageBase(models.Model):
|
||||
def get_dicom_json(self):
|
||||
try:
|
||||
json = pydicom.dcmread(self.image).to_json()
|
||||
except pydicom.errors.InvalidDicomError:
|
||||
except (pydicom.errors.InvalidDicomError, FileNotFoundError, OSError):
|
||||
return {}
|
||||
return json
|
||||
|
||||
def get_dicom_info(self):
|
||||
try:
|
||||
info = pretty_print_dicom(pydicom.dcmread(self.image))
|
||||
except pydicom.errors.InvalidDicomError:
|
||||
except (pydicom.errors.InvalidDicomError, FileNotFoundError, OSError):
|
||||
info = "File is not a dicom."
|
||||
return info
|
||||
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@ from django.urls import re_path
|
||||
from . import consumers
|
||||
|
||||
websocket_urlpatterns = [
|
||||
re_path(r'^ws/multiuser/(?P<room_name>[\w-]+)/$', consumers.MultiuserConsumer.as_asgi()),
|
||||
re_path(r'^/ws/multiuser/(?P<room_name>[\w-]+)/$', consumers.MultiuserConsumer.as_asgi()),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user