Skip to content

Commit

Permalink
Demo Origato Mr. Roboto.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Stone committed Nov 4, 2017
1 parent 997f2e2 commit 7b995b5
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 9 deletions.
10 changes: 8 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true


[packages]

dj-database-url = "*"
django = "*"
gunicorn = "*"
psycopg2 = "*"
"psycopg2" = "*"
whitenoise = "*"
requests = "*"


[requires]
python_version = "3.6"

python_version = "3.6"
119 changes: 114 additions & 5 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions hello/views.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import requests
from django.shortcuts import render
from django.http import HttpResponse

from .models import Greeting

# 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('<pre>' + r.text + '</pre> Hello from Python!')
#return render(request, 'index.html')


def db(request):
Expand Down
21 changes: 21 additions & 0 deletions hello/views.py~
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import requests
from django.shortcuts import render
from django.http import HttpResponse

from .models import Greeting

# Create your views here.
def index(request):
# return HttpResponse('Hello from Python!')
return render(request, 'index.html')


def db(request):

greeting = Greeting()
greeting.save()

greetings = Greeting.objects.all()

return render(request, 'db.html', {'greetings': greetings})

0 comments on commit 7b995b5

Please sign in to comment.