Modernize dependencies, sync with gva

This commit modernizes all requirements to the latest versions, adapts
the settings to Django 1.9 and synchronizes the settings layout with
gva.
This commit is contained in:
Jan Dittberner 2016-01-31 23:19:26 +01:00
parent 7c6ed136eb
commit ed18c4a6f9
12 changed files with 105 additions and 120 deletions

1
.gitignore vendored
View file

@ -41,3 +41,4 @@ Desktop.ini
.ropeproject .ropeproject
_build/ _build/
.vagrant/ .vagrant/
.coverage

View file

@ -1,3 +0,0 @@
.*.swp
*.pyc
.ropeproject/

View file

@ -1,15 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
class GvaRouter(object):
def route_for_task(self, task, args=None, kwargs=None):
for route in ['ldap', 'file', 'mysql', 'pgsql']:
if route in task:
return {
'exchange': route,
'exchange_type': 'direct',
'queue': route,
}
return None

View file

@ -50,9 +50,6 @@ path.append(DJANGO_ROOT)
# See: https://docs.djangoproject.com/en/dev/ref/settings/#debug # See: https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = False DEBUG = False
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-debug
TEMPLATE_DEBUG = DEBUG
########## END DEBUG CONFIGURATION
########## MANAGER CONFIGURATION ########## MANAGER CONFIGURATION
@ -119,20 +116,11 @@ MEDIA_URL = '/media/'
########## STATIC FILE CONFIGURATION ########## STATIC FILE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-root
STATIC_ROOT = normpath(join(SITE_ROOT, 'assets'))
# 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 = (
normpath(join(SITE_ROOT, 'static')),
)
# See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#staticfiles-finders # 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.AppDirectoriesFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
) )
########## END STATIC FILE CONFIGURATION ########## END STATIC FILE CONFIGURATION
@ -161,28 +149,29 @@ FIXTURE_DIRS = (
########## TEMPLATE CONFIGURATION ########## TEMPLATE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-context-processors # See: https://docs.djangoproject.com/en/1.9/ref/settings/#std:setting-TEMPLATES # noqa
TEMPLATE_CONTEXT_PROCESSORS = ( TEMPLATES = [
'django.contrib.auth.context_processors.auth', {
'django.core.context_processors.debug', 'BACKEND': 'django.template.backends.django.DjangoTemplates',
'django.core.context_processors.i18n', 'DIRS': [
'django.core.context_processors.media', normpath(join(SITE_ROOT, 'templates')),
'django.core.context_processors.static', ],
'django.core.context_processors.tz', 'APP_DIRS': True,
'django.contrib.messages.context_processors.messages', 'OPTIONS': {
'django.core.context_processors.request', 'context_processors': [
) 'django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.request',
],
},
},
]
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-loaders
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-dirs
TEMPLATE_DIRS = (
normpath(join(SITE_ROOT, 'templates')),
)
########## END TEMPLATE CONFIGURATION ########## END TEMPLATE CONFIGURATION
@ -195,6 +184,7 @@ MIDDLEWARE_CLASSES = (
'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware',
) )
########## END MIDDLEWARE CONFIGURATION ########## END MIDDLEWARE CONFIGURATION
@ -221,12 +211,8 @@ DJANGO_APPS = (
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
# Useful template tags:
# 'django.contrib.humanize',
# Admin panel and documentation: # Admin panel and documentation:
'django.contrib.admin', 'django.contrib.admin',
# 'django.contrib.admindocs',
) )
# Apps specific for this project go here. # Apps specific for this project go here.
@ -250,6 +236,15 @@ INSTALLED_APPS = DJANGO_APPS + LOCAL_APPS
LOGGING = { LOGGING = {
'version': 1, 'version': 1,
'disable_existing_loggers': False, 'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(name)s '
'%(module)s:%(lineno)d %(process)d %(thread)d %(message)s',
},
'simple': {
'format': '%(levelname)s %(name)s:%(lineno)d %(message)s',
},
},
'filters': { 'filters': {
'require_debug_false': { 'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse' '()': 'django.utils.log.RequireDebugFalse'

View file

@ -1,3 +1,4 @@
# -*- python -*-
# pymode:lint_ignore=W0401,E501 # pymode:lint_ignore=W0401,E501
""" """
Development settings and globals based on :py:mod:`gvaldap.settings.base`. Development settings and globals based on :py:mod:`gvaldap.settings.base`.
@ -6,32 +7,33 @@ Development settings and globals based on :py:mod:`gvaldap.settings.base`.
from __future__ import absolute_import from __future__ import absolute_import
from .base import * # use import * to import all settings from base
from .base import * # NOQA
########## DEBUG CONFIGURATION # ######### DEBUG CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#debug # See: https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = True DEBUG = True
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-debug # See: https://docs.djangoproject.com/en/dev/ref/settings/#template-debug
TEMPLATE_DEBUG = DEBUG TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
########## END DEBUG CONFIGURATION # ######### END DEBUG CONFIGURATION
########## EMAIL CONFIGURATION # ######### EMAIL CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-backend # See: https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
########## END EMAIL CONFIGURATION # ######### END EMAIL CONFIGURATION
########## CACHE CONFIGURATION # ######### CACHE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#caches # See: https://docs.djangoproject.com/en/dev/ref/settings/#caches
CACHES = { CACHES = {
'default': { 'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
} }
} }
########## END CACHE CONFIGURATION # ######### END CACHE CONFIGURATION
########## TOOLBAR CONFIGURATION ########## TOOLBAR CONFIGURATION
@ -44,8 +46,19 @@ MIDDLEWARE_CLASSES += (
'debug_toolbar.middleware.DebugToolbarMiddleware', 'debug_toolbar.middleware.DebugToolbarMiddleware',
) )
LOGGING['handlers'].update({
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'simple',
}
})
LOGGING['loggers'].update(dict(
[(key, {'handlers': ['console'], 'level': 'DEBUG', 'propagate': True, })
for key in ['ldapentities', 'ldaptasks']]))
DEBUG_TOOLBAR_PATCH_SETTINGS = False DEBUG_TOOLBAR_PATCH_SETTINGS = False
# http://django-debug-toolbar.readthedocs.org/en/latest/installation.html # http://django-debug-toolbar.readthedocs.org/en/latest/installation.html
INTERNAL_IPS = ('127.0.0.1',) INTERNAL_IPS = ('127.0.0.1', '10.0.2.2')
########## END TOOLBAR CONFIGURATION # ######### END TOOLBAR CONFIGURATION

View file

@ -1,3 +1,4 @@
# -*- python -*-
# pymode:lint_ignore=W0401,E501 # pymode:lint_ignore=W0401,E501
""" """
Production settings and globals based on :py:mod:`gvaldap.settings.base`. Production settings and globals based on :py:mod:`gvaldap.settings.base`.
@ -6,45 +7,29 @@ Production settings and globals based on :py:mod:`gvaldap.settings.base`.
from __future__ import absolute_import from __future__ import absolute_import
from .base import * # use import * to import all settings from base
from .base import * # NOQA
########## HOST CONFIGURATION # ######### HOST CONFIGURATION
# See: https://docs.djangoproject.com/en/1.5/releases/1.5/#allowed-hosts-required-in-production # See: https://docs.djangoproject.com/en/1.5/releases/1.5/#allowed-hosts-required-in-production # noqa
ALLOWED_HOSTS = get_env_variable('GVALDAP_ALLOWED_HOSTS').split(',') ALLOWED_HOSTS = get_env_variable('GVALDAP_ALLOWED_HOSTS').split(',')
########## END HOST CONFIGURATION # ######### END HOST CONFIGURATION
########## EMAIL CONFIGURATION # ######### EMAIL CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-backend # See: https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-host
#EMAIL_HOST = environ.get('EMAIL_HOST', 'smtp.gmail.com')
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-host-password
#EMAIL_HOST_PASSWORD = environ.get('EMAIL_HOST_PASSWORD', '')
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-host-user
#EMAIL_HOST_USER = environ.get('EMAIL_HOST_USER', 'your_email@example.com')
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-port
#EMAIL_PORT = environ.get('EMAIL_PORT', 587)
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-subject-prefix # See: https://docs.djangoproject.com/en/dev/ref/settings/#email-subject-prefix
EMAIL_SUBJECT_PREFIX = '[%s] ' % SITE_NAME EMAIL_SUBJECT_PREFIX = '[%s] ' % SITE_NAME
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-use-tls # See: https://docs.djangoproject.com/en/dev/ref/settings/#default-from-email
#EMAIL_USE_TLS = True DEFAULT_FROM_EMAIL = get_env_variable('GVALDAP_ADMIN_EMAIL')
# See: https://docs.djangoproject.com/en/dev/ref/settings/#server-email # See: https://docs.djangoproject.com/en/dev/ref/settings/#server-email
SERVER_EMAIL = get_env_variable('GVALDAP_SERVER_EMAIL') SERVER_EMAIL = get_env_variable('GVALDAP_SERVER_EMAIL')
########## END EMAIL CONFIGURATION # ######### END EMAIL CONFIGURATION
########## DATABASE CONFIGURATION # ######### CACHE CONFIGURATION
#DATABASES = {}
########## END DATABASE CONFIGURATION
########## CACHE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#caches # See: https://docs.djangoproject.com/en/dev/ref/settings/#caches
#CACHES = {} # CACHES = {}
########## END CACHE CONFIGURATION # ######### END CACHE CONFIGURATION

View file

@ -8,6 +8,9 @@ from __future__ import absolute_import
# use import * to import all settings from base # use import * to import all settings from base
from .base import * # NOQA from .base import * # NOQA
PASSWORD_HASHERS = (
'django.contrib.auth.hashers.MD5PasswordHasher',
)
########## IN-MEMORY TEST DATABASE ########## IN-MEMORY TEST DATABASE
DATABASES = { DATABASES = {
"default": { "default": {
@ -28,10 +31,6 @@ LOGGING['handlers'].update({
}) })
LOGGING['loggers'].update(dict( LOGGING['loggers'].update(dict(
[(key, {'handlers': ['console'], 'level': 'ERROR', 'propagate': True, }) [(key, {'handlers': ['console'], 'level': 'ERROR', 'propagate': True, })
for key in [ for key in ['ldapentities', 'ldaptasks']]))
'dashboard', 'domains', 'fileservertasks', 'gvacommon',
'gvawebcore', 'hostingpackages', 'ldaptasks', 'managemails',
'mysqltasks', 'osusers', 'pgsqltasks', 'taskresults',
'userdbs', 'websites']]))
BROKER_URL = BROKER_URL + '_test' BROKER_URL = BROKER_URL + '_test'
CELERY_RESULT_PERSISTENT = False CELERY_RESULT_PERSISTENT = False

View file

@ -3,23 +3,21 @@ This module defines the main URLConf for gvaldap.
""" """
from django.conf.urls import patterns, include, url from django.conf.urls import include, url
from django.conf import settings from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin from django.contrib import admin
admin.autodiscover() admin.autodiscover()
urlpatterns = patterns( urlpatterns = [
'',
url(r'^admin/', include(admin.site.urls)), url(r'^admin/', include(admin.site.urls)),
) ]
# Uncomment the next line to serve media files in dev. # Uncomment the next line to serve media files in dev.
# urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) # urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
if settings.DEBUG: if settings.DEBUG: # pragma: no cover
import debug_toolbar import debug_toolbar
urlpatterns += patterns('', urlpatterns += [
url(r'^__debug__/', include(debug_toolbar.urls)), url(r'^__debug__/', include(debug_toolbar.urls)),
) ]

View file

@ -1,10 +1,20 @@
Django==1.7.4 Django==1.9.1
django-ldapdb==0.3.2 Jinja2==2.8
bpython==0.13.2 #django-ldapdb==0.4.0
django-braces==1.4.0 -e git+https://github.com/jandd/django-ldapdb@django19#egg=django-ldapdb
django-model-utils==2.2 python-ldap==2.4.25
bpython==0.15
curtsies==0.2.6
django-braces==1.8.1
django-model-utils==2.4
logutils==0.3.3 logutils==0.3.3
celery==3.1.20 celery==3.1.20
passlib==1.6.2 amqp==1.4.9
requests==2.5.1 billiard==3.3.0.22
kombu==3.0.33
pytz==2015.7
passlib==1.6.5
requests==2.9.1
simplejson==3.8.1
-e git+https://git.gnuviech-server.de/gvacommon.git@0.2.1#egg=gvacommon
redis==2.10.5 redis==2.10.5

View file

@ -1,10 +1,12 @@
# Local development dependencies go here # Local development dependencies go here
-r test.txt -r test.txt
django-debug-toolbar==1.2.2 django-debug-toolbar==1.4
Sphinx==1.2.3 sqlparse==0.1.18
sqlparse==0.1.14 Sphinx==1.3.5
releases==0.7.0 Babel==2.2.0
Pygments==2.0.2 snowballstemmer==1.2.1
releases==1.0.0
Pygments==2.1
flake8==2.5.2 flake8==2.5.2
mccabe==0.4.0 mccabe==0.4.0
pep8==1.7.0 pep8==1.7.0

View file

@ -1,3 +1,3 @@
# Test dependencies go here. # Test dependencies go here.
-r base.txt -r base.txt
coverage==3.7.1 coverage==4.0.3