From a39e89474b9f20641cf5f6175981f031c916f63c Mon Sep 17 00:00:00 2001 From: Matt Molyneaux Date: Fri, 6 Dec 2019 22:09:08 +0000 Subject: [PATCH] Support Django 3.0 (#29) Also updates the version of PyPy we test against --- .travis.yml | 2 +- README.rst | 4 ++-- examples/protected_downloads/download/views.py | 8 ++++---- setup.py | 2 ++ tox.ini | 5 ++++- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index cd2232b..e3d7541 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ python: - "3.6" - "3.7" - "3.8" - - pypy3.5-6.0 + - pypy3.6-7.1.1 install: pip install tox-travis codecov diff --git a/README.rst b/README.rst index a8888dd..f9ce5f3 100644 --- a/README.rst +++ b/README.rst @@ -66,12 +66,12 @@ etc is done elsewhere. Supported Django Versions ========================= -Django 1.11, 2.1, and 2.2 are currently supported by this library. +Django 2.1, 2.2, and 3.0 are currently supported by this library. Supported Python Versions ========================= -Python 2.7, 3.5, 3.6. 3.7, and 3.8 are currently supported by this library. +Python 3.5, 3.6. 3.7, and 3.8 are currently supported by this library. Installation ============ diff --git a/examples/protected_downloads/download/views.py b/examples/protected_downloads/download/views.py index 36f8200..0a8f97d 100644 --- a/examples/protected_downloads/download/views.py +++ b/examples/protected_downloads/download/views.py @@ -1,5 +1,5 @@ from django.contrib.auth.decorators import login_required -from django.shortcuts import get_object_or_404, render_to_response +from django.shortcuts import get_object_or_404, render from django.http import HttpResponseForbidden from django.db.models import Q from django.template import RequestContext @@ -29,6 +29,6 @@ def download_list(request): downloads = downloads.filter(Q(is_public=True) | Q(users=request.user)) else: downloads = downloads.filter(is_public=True) - return render_to_response('download/download_list.html', - {'download_list': downloads}, - context_instance=RequestContext(request)) + return render(request, 'download/download_list.html', + {'download_list': downloads}, + context_instance=RequestContext(request)) diff --git a/setup.py b/setup.py index 3e182d5..ee87896 100644 --- a/setup.py +++ b/setup.py @@ -41,6 +41,8 @@ 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python', + 'Programming Language :: Python :: Implementation :: PyPy', + 'Programming Language :: Python :: Implementation :: CPython', 'Topic :: Software Development :: Libraries :: Python Modules', ], ) diff --git a/tox.ini b/tox.ini index 14324db..e457d08 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,8 @@ [tox] envlist = clean - py{py3,35,36,37,38}-django{21,22} + py{py3,36,37,38}-django{21,22,30} + py35-django{21,22} flake8 coverage @@ -10,11 +11,13 @@ usedevelop=True deps = django21: Django>=2.1,<2.2 django22: Django>=2.2,<2.3 + django30: Django>=3.0,<3.1 coverage changedir = examples/protected_downloads commands = python --version coverage run --rcfile=../../.coveragerc -a manage.py test django_sendfile {posargs} +setenv = PYTHONWARNINGS = default [travis] python =