From f7bd7a581427fe7b02b595f79464292447ba6478 Mon Sep 17 00:00:00 2001 From: Reggie Riser Date: Thu, 28 Dec 2017 15:52:22 -0500 Subject: [PATCH] Fixing leftovers from migration to Django 1.11 and Python 3.6. --- CONTRIBUTING.rst | 4 ++-- docs/deployment-on-pythonanywhere.rst | 2 +- docs/deployment-with-elastic-beanstalk.rst | 2 +- hooks/pre_gen_project.py | 4 ++-- requirements_to_watch.txt | 4 +--- setup.py | 5 ++--- {{cookiecutter.project_slug}}/.travis.yml | 2 +- .../compose/local/django/Dockerfile | 2 +- .../compose/production/django/Dockerfile | 2 +- {{cookiecutter.project_slug}}/docs/docker_ec2.rst | 2 +- {{cookiecutter.project_slug}}/runtime.txt | 2 +- .../{{cookiecutter.project_slug}}/users/models.py | 2 +- .../{{cookiecutter.project_slug}}/users/tests/test_urls.py | 2 +- .../{{cookiecutter.project_slug}}/users/views.py | 5 ++--- 14 files changed, 18 insertions(+), 22 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index efff1fad..0e4e258c 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -39,9 +39,9 @@ To run all tests using various versions of python in virtualenvs defined in tox. It is possible to tests with some versions of python, to do this the command is:: - $ tox -e py34,py35 + $ tox -e py35,py36 -Will run py.test with the python3.4, and python3.5 interpreters, for +Will run py.test with the python3.5, and python3.6 interpreters, for example. To run a particular test with tox for against your current Python version:: diff --git a/docs/deployment-on-pythonanywhere.rst b/docs/deployment-on-pythonanywhere.rst index 07b46bc0..d70684bd 100644 --- a/docs/deployment-on-pythonanywhere.rst +++ b/docs/deployment-on-pythonanywhere.rst @@ -35,7 +35,7 @@ Make sure your project is fully commited and pushed up to Bitbucket or Github or git clone # you can also use hg cd my-project-name - mkvirtualenv --python=/usr/bin/python3.5 my-project-name + mkvirtualenv --python=/usr/bin/python3.6 my-project-name pip install -r requirements/production.txt # may take a few minutes diff --git a/docs/deployment-with-elastic-beanstalk.rst b/docs/deployment-with-elastic-beanstalk.rst index e8aae885..5edf1795 100644 --- a/docs/deployment-with-elastic-beanstalk.rst +++ b/docs/deployment-with-elastic-beanstalk.rst @@ -20,7 +20,7 @@ Instructions If you haven't done so, create a directory of environments:: - eb init -p python3.4 MY_PROJECT_SLUG + eb init -p python3.6 MY_PROJECT_SLUG Replace `MY_PROJECT_SLUG` with the value you entered for `project_slug`. diff --git a/hooks/pre_gen_project.py b/hooks/pre_gen_project.py index c7a68450..d509a464 100644 --- a/hooks/pre_gen_project.py +++ b/hooks/pre_gen_project.py @@ -16,7 +16,7 @@ if docker == 'n': python_major_version = sys.version_info[0] if python_major_version == 2: - sys.stdout.write("WARNING: Cookiecutter Django does not support Python 2! Stability is guaranteed with Python 3.4+ only. Are you sure you want to proceed? (y/n)") + sys.stdout.write("WARNING: Cookiecutter Django does not support Python 2! Stability is guaranteed with Python 3.6+ only. Are you sure you want to proceed? (y/n)") yes_options = set(['y']) no_options = set(['n', '']) @@ -26,6 +26,6 @@ if docker == 'n': elif choice in yes_options: pass else: - sys.stdout.write("Please respond with %s or %s" + sys.stdout.write("Please respond with %s or %s" % (', '.join([o for o in yes_options if not o == '']) , ', '.join([o for o in no_options if not o == '']))) diff --git a/requirements_to_watch.txt b/requirements_to_watch.txt index 4440448d..91f0041b 100644 --- a/requirements_to_watch.txt +++ b/requirements_to_watch.txt @@ -1,4 +1,2 @@ -# These requirements prevented an upgrade to Django 1.10. -django-coverage-plugin==1.5.0 +# These requirements prevented an upgrade to Django 1.11. django-autoslug==1.9.3 - diff --git a/setup.py b/setup.py index a300dc7f..29db1f6d 100644 --- a/setup.py +++ b/setup.py @@ -34,14 +34,13 @@ setup( classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', - 'Framework :: Django :: 1.10', + 'Framework :: Django :: 1.11', 'Intended Audience :: Developers', 'Natural Language :: English', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Software Development', diff --git a/{{cookiecutter.project_slug}}/.travis.yml b/{{cookiecutter.project_slug}}/.travis.yml index 216b8709..5ca54d00 100644 --- a/{{cookiecutter.project_slug}}/.travis.yml +++ b/{{cookiecutter.project_slug}}/.travis.yml @@ -8,4 +8,4 @@ before_install: - sudo apt-get install -qq libsqlite3-dev libxml2 libxml2-dev libssl-dev libbz2-dev wget curl llvm language: python python: - - "3.5" + - "3.6" diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index e62b524a..b9ee34b7 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.5 +FROM python:3.6 ENV PYTHONUNBUFFERED 1 diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index fcbe5184..48923c80 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.5 +FROM python:3.6 ENV PYTHONUNBUFFERED 1 diff --git a/{{cookiecutter.project_slug}}/docs/docker_ec2.rst b/{{cookiecutter.project_slug}}/docs/docker_ec2.rst index 3e43ed76..606d2956 100644 --- a/{{cookiecutter.project_slug}}/docs/docker_ec2.rst +++ b/{{cookiecutter.project_slug}}/docs/docker_ec2.rst @@ -58,7 +58,7 @@ The `Docker compose documentation`_ explains in detail what you can accomplish i build: database webapp: build: webapp: - command: /usr/bin/python3.4 manage.py runserver 0.0.0.0:8000 # dev setting + command: /usr/bin/python3.6 manage.py runserver 0.0.0.0:8000 # dev setting # command: gunicorn -b 0.0.0.0:8000 wsgi:application # production setting volumes: - webapp/your_project_name:/path/to/container/workdir/ diff --git a/{{cookiecutter.project_slug}}/runtime.txt b/{{cookiecutter.project_slug}}/runtime.txt index cfa5aa5c..02d0df5e 100644 --- a/{{cookiecutter.project_slug}}/runtime.txt +++ b/{{cookiecutter.project_slug}}/runtime.txt @@ -1 +1 @@ -python-3.6.2 +python-3.6.3 diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py index c06f15da..9a831b48 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py @@ -1,6 +1,6 @@ from django.contrib.auth.models import AbstractUser -from django.core.urlresolvers import reverse from django.db import models +from django.urls import reverse from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py index 6e181cc8..4935b0f3 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py @@ -1,4 +1,4 @@ -from django.core.urlresolvers import reverse, resolve +from django.urls import reverse, resolve from test_plus.test import TestCase diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py index 777f42b7..acde4a8f 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py @@ -1,7 +1,6 @@ -from django.core.urlresolvers import reverse -from django.views.generic import DetailView, ListView, RedirectView, UpdateView - from django.contrib.auth.mixins import LoginRequiredMixin +from django.urls import reverse +from django.views.generic import DetailView, ListView, RedirectView, UpdateView from .models import User