ENH: Upgrade versions (django 1.10) (#8)
This commit is contained in:
parent
76e5f1dc58
commit
0745af67a6
7 changed files with 46 additions and 40 deletions
10
ccdb/utils/middleware.py
Normal file
10
ccdb/utils/middleware.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
from django.utils.deprecation import MiddlewareMixin
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
|
|
||||||
|
if settings.DEBUG:
|
||||||
|
from debug_toolbar.middleware import DebugToolbarMiddleware
|
||||||
|
|
||||||
|
class PatchedDebugToolbarMiddleware(MiddlewareMixin,
|
||||||
|
DebugToolbarMiddleware):
|
||||||
|
pass
|
|
@ -1,7 +1,6 @@
|
||||||
"""
|
"""
|
||||||
Django settings for CCDB
|
Django settings for CCDB
|
||||||
"""
|
"""
|
||||||
from django.utils.translation import ugettext_lazy as _
|
|
||||||
|
|
||||||
import environ
|
import environ
|
||||||
|
|
||||||
|
@ -46,7 +45,7 @@ INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
|
||||||
|
|
||||||
# MIDDLEWARE CONFIGURATION
|
# MIDDLEWARE CONFIGURATION
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
MIDDLEWARE_CLASSES = (
|
MIDDLEWARE = (
|
||||||
# Make sure djangosecure.middleware.SecurityMiddleware is listed first
|
# Make sure djangosecure.middleware.SecurityMiddleware is listed first
|
||||||
'django.middleware.security.SecurityMiddleware',
|
'django.middleware.security.SecurityMiddleware',
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
|
@ -64,14 +63,15 @@ DEBUG = env.bool("DJANGO_DEBUG", False)
|
||||||
|
|
||||||
# FIXTURE CONFIGURATION
|
# FIXTURE CONFIGURATION
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-FIXTURE_DIRS
|
# https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-FIXTURE_DIRS
|
||||||
FIXTURE_DIRS = (
|
FIXTURE_DIRS = (
|
||||||
str(APPS_DIR.path('fixtures')),
|
str(APPS_DIR.path('fixtures')),
|
||||||
)
|
)
|
||||||
|
|
||||||
# EMAIL CONFIGURATION
|
# EMAIL CONFIGURATION
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND', default='django.core.mail.backends.smtp.EmailBackend')
|
EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND',
|
||||||
|
default='django.core.mail.backends.smtp.EmailBackend')
|
||||||
|
|
||||||
# MANAGER CONFIGURATION
|
# MANAGER CONFIGURATION
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
@ -109,22 +109,16 @@ USE_TZ = True
|
||||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#templates
|
# See: https://docs.djangoproject.com/en/dev/ref/settings/#templates
|
||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-TEMPLATES-BACKEND
|
|
||||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-dirs
|
|
||||||
'DIRS': [
|
'DIRS': [
|
||||||
str(APPS_DIR.path('templates')),
|
str(APPS_DIR.path('templates')),
|
||||||
],
|
],
|
||||||
'OPTIONS': {
|
'OPTIONS': {
|
||||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-debug
|
|
||||||
'debug': DEBUG,
|
'debug': DEBUG,
|
||||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-loaders
|
|
||||||
# https://docs.djangoproject.com/en/dev/ref/templates/api/#loader-types
|
|
||||||
'loaders': [
|
'loaders': [
|
||||||
'django.template.loaders.filesystem.Loader',
|
'django.template.loaders.filesystem.Loader',
|
||||||
'django.template.loaders.app_directories.Loader',
|
'django.template.loaders.app_directories.Loader',
|
||||||
],
|
],
|
||||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-context-processors
|
|
||||||
'context_processors': [
|
'context_processors': [
|
||||||
'django.template.context_processors.debug',
|
'django.template.context_processors.debug',
|
||||||
'django.template.context_processors.request',
|
'django.template.context_processors.request',
|
||||||
|
@ -141,9 +135,6 @@ TEMPLATES = [
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
# See: http://django-crispy-forms.readthedocs.org/en/latest/install.html#template-packs
|
|
||||||
CRISPY_TEMPLATE_PACK = 'bootstrap3'
|
|
||||||
|
|
||||||
# STATIC FILE CONFIGURATION
|
# STATIC FILE CONFIGURATION
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-root
|
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-root
|
||||||
|
@ -152,12 +143,10 @@ STATIC_ROOT = str(ROOT_DIR('staticfiles'))
|
||||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
|
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
|
||||||
STATIC_URL = '/static/'
|
STATIC_URL = '/static/'
|
||||||
|
|
||||||
# See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#std:setting-STATICFILES_DIRS
|
|
||||||
STATICFILES_DIRS = (
|
STATICFILES_DIRS = (
|
||||||
str(APPS_DIR.path('static')),
|
str(APPS_DIR.path('static')),
|
||||||
)
|
)
|
||||||
|
|
||||||
# See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#staticfiles-finders
|
|
||||||
STATICFILES_FINDERS = (
|
STATICFILES_FINDERS = (
|
||||||
'django.contrib.staticfiles.finders.FileSystemFinder',
|
'django.contrib.staticfiles.finders.FileSystemFinder',
|
||||||
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
||||||
|
@ -207,8 +196,10 @@ REST_FRAMEWORK = {
|
||||||
'rest_framework.authentication.TokenAuthentication',
|
'rest_framework.authentication.TokenAuthentication',
|
||||||
'rest_framework.authentication.SessionAuthentication',
|
'rest_framework.authentication.SessionAuthentication',
|
||||||
],
|
],
|
||||||
'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.NamespaceVersioning',
|
'DEFAULT_VERSIONING_CLASS':
|
||||||
'DEFAULT_PAGINATION_CLASS': 'drf_ember_pagination.EmberPageNumberPagination',
|
'rest_framework.versioning.NamespaceVersioning',
|
||||||
|
'DEFAULT_PAGINATION_CLASS':
|
||||||
|
'drf_ember_pagination.EmberPageNumberPagination',
|
||||||
'PAGE_SIZE': 100,
|
'PAGE_SIZE': 100,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,12 +41,12 @@ EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND',
|
||||||
|
|
||||||
# django-debug-toolbar
|
# django-debug-toolbar
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
|
MIDDLEWARE += ('ccdb.utils.middleware.PatchedDebugToolbarMiddleware',)
|
||||||
INSTALLED_APPS += ('debug_toolbar', )
|
INSTALLED_APPS += ('debug_toolbar', )
|
||||||
|
|
||||||
# Testing
|
# Testing
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
INSTALLED_APPS += ('django_extensions', 'test_without_migrations')
|
INSTALLED_APPS += ('django_extensions',)
|
||||||
|
|
||||||
INTERNAL_IPS = ('127.0.0.1', )
|
INTERNAL_IPS = ('127.0.0.1', )
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ SECURITY_MIDDLEWARE = (
|
||||||
)
|
)
|
||||||
|
|
||||||
# Make sure djangosecure.middleware.SecurityMiddleware is listed first
|
# Make sure djangosecure.middleware.SecurityMiddleware is listed first
|
||||||
MIDDLEWARE_CLASSES = SECURITY_MIDDLEWARE + MIDDLEWARE_CLASSES
|
MIDDLEWARE = SECURITY_MIDDLEWARE + MIDDLEWARE
|
||||||
|
|
||||||
# set this to 60 seconds and then to 518400 when you can prove it works
|
# set this to 60 seconds and then to 518400 when you can prove it works
|
||||||
SECURE_HSTS_SECONDS = 60
|
SECURE_HSTS_SECONDS = 60
|
||||||
|
@ -107,8 +107,13 @@ SERVER_EMAIL = env('DJANGO_SERVER_EMAIL', default=DEFAULT_FROM_EMAIL)
|
||||||
# See:
|
# See:
|
||||||
# https://docs.djangoproject.com/en/dev/ref/templates/api/#django.template.loaders.cached.Loader
|
# https://docs.djangoproject.com/en/dev/ref/templates/api/#django.template.loaders.cached.Loader
|
||||||
TEMPLATES[0]['OPTIONS']['loaders'] = [
|
TEMPLATES[0]['OPTIONS']['loaders'] = [
|
||||||
('django.template.loaders.cached.Loader', [
|
(
|
||||||
'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', ]),
|
'django.template.loaders.cached.Loader',
|
||||||
|
[
|
||||||
|
'django.template.loaders.filesystem.Loader',
|
||||||
|
'django.template.loaders.app_directories.Loader'
|
||||||
|
]
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
# DATABASE CONFIGURATION
|
# DATABASE CONFIGURATION
|
||||||
|
@ -174,5 +179,6 @@ CORS_ORIGIN_WHITELIST = env.tuple('CORS_ORIGIN_WHITELIST', None)
|
||||||
DJOSER = {
|
DJOSER = {
|
||||||
'SITE_NAME': 'CCDB',
|
'SITE_NAME': 'CCDB',
|
||||||
'DOMAIN': 'https://ccdb.info',
|
'DOMAIN': 'https://ccdb.info',
|
||||||
'PASSWORD_RESET_CONFIRM_URL': 'https://ccdb.info/password-reset?uid={uid}&token={token}',
|
'PASSWORD_RESET_CONFIRM_URL': 'https://ccdb.info/password-reset?'
|
||||||
|
'uid={uid}&token={token}',
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,9 +8,11 @@ from django.core.urlresolvers import reverse_lazy
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(settings.ADMIN_URL, include(admin.site.urls)),
|
url(settings.ADMIN_URL, include(admin.site.urls)),
|
||||||
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
|
url(r'^api-auth/', include('rest_framework.urls',
|
||||||
|
namespace='rest_framework')),
|
||||||
url(r'^api/', include('ccdb.api.urls', namespace='api')),
|
url(r'^api/', include('ccdb.api.urls', namespace='api')),
|
||||||
url(r'^$', RedirectView.as_view(url=reverse_lazy('admin:index'), permanent=True)),
|
url(r'^$', RedirectView.as_view(url=reverse_lazy('admin:index'),
|
||||||
|
permanent=True)),
|
||||||
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||||
|
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
|
|
|
@ -1,28 +1,25 @@
|
||||||
django==1.8.13
|
django==1.10
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
django-environ==0.4.0
|
django-environ==0.4.0
|
||||||
django-secure==1.0.1
|
django-secure==1.0.1
|
||||||
whitenoise==3.2
|
whitenoise==3.2.1
|
||||||
|
|
||||||
# Views
|
|
||||||
django-extra-views==0.7.1
|
|
||||||
|
|
||||||
# DB
|
# DB
|
||||||
psycopg2==2.6.1
|
psycopg2==2.6.2
|
||||||
|
|
||||||
# Time zones support
|
# Time zones support
|
||||||
pytz==2016.4
|
pytz==2016.6.1
|
||||||
|
|
||||||
# Date/time strings
|
# Date/time strings
|
||||||
python-dateutil==2.5.3
|
python-dateutil==2.5.3
|
||||||
|
|
||||||
# HTTP
|
# HTTP
|
||||||
requests==2.10.0
|
requests==2.11.0
|
||||||
|
|
||||||
# REST
|
# REST
|
||||||
djangorestframework==3.3.3
|
djangorestframework==3.4.4
|
||||||
django-cors-headers==1.1.0
|
django-cors-headers==1.1.0
|
||||||
django-filter==0.13.0
|
django-filter==0.14.0
|
||||||
djoser==0.4.3
|
djoser==0.5.0
|
||||||
git+git://github.com/thermokarst/drf_ember_pagination.git
|
git+git://github.com/thermokarst/drf_ember_pagination.git
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
-r base.txt
|
-r base.txt
|
||||||
|
|
||||||
Werkzeug==0.11.10
|
Werkzeug==0.11.10
|
||||||
django-debug-toolbar==1.4
|
django-debug-toolbar==1.5
|
||||||
django-extensions==1.6.7
|
django-extensions==1.7.1
|
||||||
flake8==2.5.4
|
flake8==3.0.4
|
||||||
pygraphviz==1.3.1
|
pygraphviz==1.3.1
|
||||||
ipython==4.2.0
|
ipython==5.1.0
|
||||||
factory-boy==2.7.0
|
factory-boy==2.7.0
|
||||||
|
|
Loading…
Add table
Reference in a new issue