Update django to 1.11.x

This commit is contained in:
Takuya Noguchi 2017-10-25 00:42:43 +09:00
parent a6979d731a
commit 638277ed07
4 changed files with 37 additions and 18 deletions

View File

@ -1,23 +1,23 @@
"""
Django settings for this project.
Generated by 'django-admin startproject' using Django 1.8.1.
Generated by 'django-admin startproject' using Django 1.11.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
# The SECRET_KEY is provided via an environment variable in OpenShift
@ -35,7 +35,7 @@ ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = (
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
@ -44,19 +44,19 @@ INSTALLED_APPS = (
'django.contrib.staticfiles',
'debug_toolbar',
'welcome',
)
]
MIDDLEWARE_CLASSES = (
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
)
'debug_toolbar.middleware.DebugToolbarMiddleware',
]
ROOT_URLCONF = 'project.urls'
@ -80,7 +80,7 @@ WSGI_APPLICATION = 'wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
from . import database
@ -89,8 +89,27 @@ DATABASES = {
}
# Password validation
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/
# https://docs.djangoproject.com/en/1.11/topics/i18n/
LANGUAGE_CODE = 'en-us'
@ -104,7 +123,7 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/
# https://docs.djangoproject.com/en/1.11/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')

View File

@ -1,4 +1,4 @@
django>=1.8,<1.9
django>=1.11,<1.12
django-debug-toolbar==1.8
gunicorn==19.4.5
psycopg2==2.7.3.1

View File

@ -263,14 +263,14 @@ $ git push</pre>
</ol>
<p>
Now it is time to add your own code.
Follow along the <a href="https://docs.djangoproject.com/en/1.8/intro/tutorial01/">Django tutorial</a> to learn more about Django.
Follow along the <a href="https://docs.djangoproject.com/en/1.11/intro/tutorial01/">Django tutorial</a> to learn more about Django.
</p>
<p>
If you are running Django's development server in your local host, you can see more information
about this request using the toolbar on the right.<br>
Please note that by default your Django settings have <code>DEBUG = True</code> and that is not appropriate for production use,
but very handy during development.<br>
Refer to the <a href="https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/">Deployment Checklist</a>
Refer to the <a href="https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/">Deployment Checklist</a>
before taking this project into a production environment.
</p>

View File

@ -4,7 +4,7 @@ WSGI config for project project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os