summaryrefslogtreecommitdiff
path: root/tests/asgi/urls.py
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2019-04-12 06:15:18 -0700
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-06-20 12:29:43 +0200
commita415ce70bef6d91036b00dd2c8544aed7aeeaaed (patch)
tree3583cef22e9b56d2ed52456ab586d9c47620bc51 /tests/asgi/urls.py
parentcce47ff65a4dd3786c049ec14ee889e128ca7de9 (diff)
Fixed #30451 -- Added ASGI handler and coroutine-safety.
This adds an ASGI handler, asgi.py file for the default project layout, a few async utilities and adds async-safety to many parts of Django.
Diffstat (limited to 'tests/asgi/urls.py')
-rw-r--r--tests/asgi/urls.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/asgi/urls.py b/tests/asgi/urls.py
new file mode 100644
index 0000000000..4177ec8c9a
--- /dev/null
+++ b/tests/asgi/urls.py
@@ -0,0 +1,15 @@
+from django.http import FileResponse, HttpResponse
+from django.urls import path
+
+
+def helloworld(request):
+ return HttpResponse('Hello World!')
+
+
+test_filename = __file__
+
+
+urlpatterns = [
+ path('', helloworld),
+ path('file/', lambda x: FileResponse(open(test_filename, 'rb'))),
+]