1. from django.http import FileResponse, HttpResponse
    
  2. from django.urls import path
    
  3. 
    
  4. 
    
  5. def helloworld(request):
    
  6.     return HttpResponse("Hello World!")
    
  7. 
    
  8. 
    
  9. urlpatterns = [
    
  10.     path("", helloworld),
    
  11.     path("file/", lambda x: FileResponse(open(__file__, "rb"))),
    
  12. ]