I'm setting app on Heroku. I do in instruction like so:
In error 1, I code in Notepad and run it in command:
import requests
from django.shortcuts import render
from django.http import HttpResponse
from .models import Greeting
# Create your views here.
def index(request):
r = requests.get('http://httpbin.org/status/418')
print(r.text)
return HttpResponse('<pre>' + r.text + '</pre>')
def db(request):
greeting = Greeting()
greeting.save()
greetings = Greeting.objects.all()
return render(request, 'db.html', {'greetings': greetings})
But it dont run like instruction
My command appeard that so i dont know what can I should do.
I was try like Stack help
Your code above is correct. Please install requests on your (master) as follows:
Ja ~/python-getting-started
(master)pipenv install requests
heroku local