From 5453dce1fda95a5de17a09e9473cdfbe7605b261 Mon Sep 17 00:00:00 2001 From: ARTIT1005 Date: Mon, 3 Aug 2020 09:59:28 +0900 Subject: [PATCH 1/2] Demo --- hello/views.py | 5 +++-- requirements.txt | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hello/views.py b/hello/views.py index c2480724b..05a08fa3e 100644 --- a/hello/views.py +++ b/hello/views.py @@ -5,8 +5,9 @@ # Create your views here. def index(request): - # return HttpResponse('Hello from Python!') - return render(request, "index.html") + r = requests.get('http://httpbin.org/status/418') + print(r.text) + return HttpResponse('
' + r.text + '
') def db(request): diff --git a/requirements.txt b/requirements.txt index 4af6a3765..c079bf3b7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ django gunicorn -django-heroku \ No newline at end of file +django-heroku +requests \ No newline at end of file From 50d8419b0606ba544c9a4d174b9e260682b306dd Mon Sep 17 00:00:00 2001 From: ARTIT1005 Date: Mon, 3 Aug 2020 10:02:17 +0900 Subject: [PATCH 2/2] Demo2 --- hello/views.py | 1 + 1 file changed, 1 insertion(+) diff --git a/hello/views.py b/hello/views.py index 05a08fa3e..e71195efc 100644 --- a/hello/views.py +++ b/hello/views.py @@ -1,3 +1,4 @@ +import requests from django.shortcuts import render from django.http import HttpResponse