django/tests/asgi/urls.py

16 lines
290 B
Python
Raw Normal View History

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'))),
]