From bea5b138ef292718addf3f4aa4cba7128b3916cd Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sun, 20 Mar 2016 14:31:32 -0300 Subject: [PATCH] Update test project with HTTP endpoint --- testproject/README.rst | 5 +++++ testproject/chtest/views.py | 5 +++++ testproject/testproject/urls.py | 11 ++++++++--- 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 testproject/README.rst create mode 100644 testproject/chtest/views.py diff --git a/testproject/README.rst b/testproject/README.rst new file mode 100644 index 0000000..00dbac1 --- /dev/null +++ b/testproject/README.rst @@ -0,0 +1,5 @@ +Channels Test Project +===================== + +This subdirectory contains benchmarking code and a companion Django project +that can be used to benchmark Channels for both HTTP and WebSocket performance. diff --git a/testproject/chtest/views.py b/testproject/chtest/views.py new file mode 100644 index 0000000..4bed90e --- /dev/null +++ b/testproject/chtest/views.py @@ -0,0 +1,5 @@ +from django.http import HttpResponse + + +def index(request): + return HttpResponse("OK") diff --git a/testproject/testproject/urls.py b/testproject/testproject/urls.py index 42ae607..1dca076 100644 --- a/testproject/testproject/urls.py +++ b/testproject/testproject/urls.py @@ -1,6 +1,11 @@ -from django.conf.urls import include, url -from chtest import consumers -urlpatterns = [] +from django.conf.urls import url +from chtest import consumers, views + + +urlpatterns = [ + url(r'^$', views.index), +] + channel_routing = { "websocket.receive": consumers.ws_message,