Skip to content

Commit

Permalink
Django 3.0 render() fix
Browse files Browse the repository at this point in the history
  • Loading branch information
erlendr committed Apr 11, 2020
1 parent 0df133e commit d40e8bd
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 12 deletions.
28 changes: 22 additions & 6 deletions poetry.lock

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

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ requests = "^2.23.0"
six = "^1.14.0"
stripe = "^2.45.0"
whitenoise = "^5.0.1"
Django = "~2.2.12"
Django = "~3.0.5"
Padding = "^0.5"
SQLAlchemy = "^1.3.16"
django-postgrespool2 = "^1.0.1"
Expand Down
13 changes: 8 additions & 5 deletions swapi/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import unicode_literals

from django.shortcuts import render_to_response, redirect
from django.shortcuts import render, redirect
from django.views.decorators.csrf import csrf_exempt
from django.core.cache import cache
from django.conf import settings
Expand All @@ -16,7 +16,8 @@
def index(request):

stripe_key = settings.STRIPE_KEYS['publishable']
return render_to_response(
return render(
request,
'index.html',
{
"stripe_key": stripe_key
Expand All @@ -25,7 +26,7 @@ def index(request):


def documentation(request):
return render_to_response("documentation.html")
return render(request, "documentation.html")


def about(request):
Expand All @@ -35,7 +36,8 @@ def about(request):
data = get_resource_stats()
cache.set('resource_data', data, 10000)
data['stripe_key'] = stripe_key
return render_to_response(
return render(
request,
"about.html",
data
)
Expand Down Expand Up @@ -71,7 +73,8 @@ def stripe_donation(request):
@login_required
def stats(request):
data = {}
return render_to_response(
return render(
request,
'stats.html',
data
)

0 comments on commit d40e8bd

Please sign in to comment.