From 6d7265144b2c0efd32b818ac0e9feefb44f816da Mon Sep 17 00:00:00 2001 From: overskilling Date: Tue, 24 May 2022 21:22:39 -0400 Subject: [PATCH 1/2] Updated following tutorial --- hello/views.py | 7 ++++--- requirements.in | 7 +++++++ requirements.txt | 40 +++++++++++++++++++++++++++++++++++++--- 3 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 requirements.in diff --git a/hello/views.py b/hello/views.py index c2480724b..e5642341a 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 @@ -5,9 +6,9 @@ # Create your views here. def index(request): - # return HttpResponse('Hello from Python!') - return render(request, "index.html") - + r = requests.get('https://httpbin.org/status/418') + print(r.text) + return HttpResponse('
' + r.text + '
') def db(request): diff --git a/requirements.in b/requirements.in new file mode 100644 index 000000000..0692d0eee --- /dev/null +++ b/requirements.in @@ -0,0 +1,7 @@ +# For testing and development + +# For the application +django +gunicorn +django-heroku +requests \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 4af6a3765..8134858fc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,37 @@ -django -gunicorn -django-heroku \ No newline at end of file +# +# This file is autogenerated by pip-compile with python 3.9 +# To update, run: +# +# pip-compile +# +asgiref==3.5.2 + # via django +certifi==2022.5.18.1 + # via requests +charset-normalizer==2.0.12 + # via requests +dj-database-url==0.5.0 + # via django-heroku +django==4.0.4 + # via + # -r requirements.in + # django-heroku +django-heroku==0.3.1 + # via -r requirements.in +gunicorn==20.1.0 + # via -r requirements.in +idna==3.3 + # via requests +psycopg2==2.9.3 + # via django-heroku +requests==2.27.1 + # via -r requirements.in +sqlparse==0.4.2 + # via django +urllib3==1.26.9 + # via requests +whitenoise==6.1.0 + # via django-heroku + +# The following packages are considered to be unsafe in a requirements file: +# setuptools From 503e966322e5a4d79f077c71c13c6ae20e05ee19 Mon Sep 17 00:00:00 2001 From: overskilling Date: Tue, 24 May 2022 21:29:06 -0400 Subject: [PATCH 2/2] Back to original --- hello/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hello/views.py b/hello/views.py index e5642341a..ca9792952 100644 --- a/hello/views.py +++ b/hello/views.py @@ -6,9 +6,9 @@ # Create your views here. def index(request): - r = requests.get('https://httpbin.org/status/418') - print(r.text) - return HttpResponse('
' + r.text + '
') + # return HttpResponse('Hello from Python!') + return render(request, "index.html") + def db(request):