From 22bcda23dcbd7f37c8999b3a704a72b6cbc7babd Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 4 Nov 2014 23:58:20 +0800 Subject: [PATCH] websocket --- webroot/AutoSa/AutoSa/urls.py | 1 + webroot/AutoSa/AutoSa/views.py | 5 ++++- webroot/AutoSa/templates/websocket.html | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 webroot/AutoSa/templates/websocket.html diff --git a/webroot/AutoSa/AutoSa/urls.py b/webroot/AutoSa/AutoSa/urls.py index ac9b697f3..fb73d938e 100644 --- a/webroot/AutoSa/AutoSa/urls.py +++ b/webroot/AutoSa/AutoSa/urls.py @@ -36,4 +36,5 @@ urlpatterns = patterns('', (r'^killSession/$', views.killSession), (r'^echo/$', views.echo), (r'^low_case/$', views.low_case), + (r'^test_websocket/$', view.test_websocket), ) diff --git a/webroot/AutoSa/AutoSa/views.py b/webroot/AutoSa/AutoSa/views.py index a92666c60..e68768c14 100644 --- a/webroot/AutoSa/AutoSa/views.py +++ b/webroot/AutoSa/AutoSa/views.py @@ -1011,7 +1011,6 @@ def echo(request): request.websocket.send(message) - @accept_websocket def lower_case(request): f = open('/tmp/websocket.log') @@ -1021,6 +1020,10 @@ def lower_case(request): time.sleep(5) +def test_websocket(request): + return HttpResponse('websocket.html') + + diff --git a/webroot/AutoSa/templates/websocket.html b/webroot/AutoSa/templates/websocket.html new file mode 100644 index 000000000..def7bd0d8 --- /dev/null +++ b/webroot/AutoSa/templates/websocket.html @@ -0,0 +1,14 @@ + +WebSocket Test +

WebSocket Test

\ No newline at end of file