Merge pull request #364 from ThomasWaldmann/py37

py37 and django2 fixes
This commit is contained in:
TW 2018-11-04 21:14:15 +01:00 committed by GitHub
commit a8128fe9e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 45 additions and 54 deletions

View File

@ -4,16 +4,6 @@ language: python
os: linux os: linux
dist: trusty
python:
- "2.7"
- "pypy"
- "3.4"
- "3.5"
- "3.6"
- "3.6-dev"
env: env:
global: global:
- SECRET_KEY=justfortravis - SECRET_KEY=justfortravis
@ -22,24 +12,24 @@ env:
- TEST_K="not ddns_client" - TEST_K="not ddns_client"
- TEST_OPTS="" - TEST_OPTS=""
- COVERAGE="" - COVERAGE=""
matrix:
- DJANGO=1.11
matrix: matrix:
exclude:
- python: "2.7"
env: DJANGO=1.11
- python: "3.6"
env: DJANGO=1.11
- python: "3.6-dev"
env: DJANGO=1.11
include: include:
- python: "2.7" - python: "2.7"
dist: trusty
env: DJANGO=1.11 COVERAGE="coverage run -m" TEST_K="not ddns_client" TEST_OPTS="--pep8" env: DJANGO=1.11 COVERAGE="coverage run -m" TEST_K="not ddns_client" TEST_OPTS="--pep8"
- python: "3.6" - python: "3.4"
dist: trusty
env: DJANGO=1.11 env: DJANGO=1.11
- python: "3.6-dev" - python: "3.5"
env: DJANGO=2.0 dist: trusty
env: DJANGO=1.11
- python: "3.6"
dist: trusty
env: DJANGO=1.11
- python: "3.7"
dist: xenial
env: DJANGO=2.1
install: install:
- ./scripts/travis/install.sh - ./scripts/travis/install.sh

View File

@ -15,7 +15,7 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='UserProfile', name='UserProfile',
fields=[ fields=[
('user', models.OneToOneField(related_name='profile', primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL, verbose_name='user')), ('user', models.OneToOneField(related_name='profile', primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL, verbose_name='user', on_delete=models.CASCADE)),
('language', models.CharField(default=b'', choices=[(b'en', b'English'), (b'de', b'German'), (b'fr', b'French'), (b'it', b'Italian'), (b'pl', b'Polish'), (b'zh-cn', b'Chinese (China)')], max_length=10, blank=True, null=True, verbose_name='language')), ('language', models.CharField(default=b'', choices=[(b'en', b'English'), (b'de', b'German'), (b'fr', b'French'), (b'it', b'Italian'), (b'pl', b'Polish'), (b'zh-cn', b'Chinese (China)')], max_length=10, blank=True, null=True, verbose_name='language')),
], ],
options={ options={

View File

@ -1,22 +1,22 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.conf.urls import url from django.conf.urls import url
from django.contrib.auth.views import login, logout, password_reset, password_reset_done, \ from django.contrib.auth.views import LoginView, LogoutView, \
password_reset_confirm, password_reset_complete PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView
urlpatterns = ( urlpatterns = (
# login and logout url # login and logout url
url(r'^login/$', login, {'template_name': 'login.html'}, name='login'), url(r'^login/$', LoginView.as_view(), {'template_name': 'login.html'}, name='login'),
# or use logout with template 'logout.html' # or use logout with template 'logout.html'
url(r'^logout/$', logout, name='logout'), url(r'^logout/$', LogoutView.as_view(), name='logout'),
# password reset urls # password reset urls
url(r'^password_reset/$', password_reset, {'template_name': 'password_reset.html'}, url(r'^password_reset/$', PasswordResetView.as_view(), {'template_name': 'password_reset.html'},
name='password_reset'), name='password_reset'),
url(r'^password_reset_done/$', password_reset_done, url(r'^password_reset_done/$', PasswordResetDoneView.as_view(),
{'template_name': 'password_reset_done.html'}, name='password_reset_done'), {'template_name': 'password_reset_done.html'}, name='password_reset_done'),
url(r'^password_reset_confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$', url(r'^password_reset_confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$',
password_reset_confirm, {'template_name': 'password_reset_confirm.html'}, PasswordResetConfirmView.as_view(), {'template_name': 'password_reset_confirm.html'},
name='password_reset_confirm'), name='password_reset_confirm'),
url(r'^password_reset_complete/$', password_reset_complete, url(r'^password_reset_complete/$', PasswordResetCompleteView.as_view(),
{'template_name': 'password_reset_complete.html'}, name='password_reset_complete'), {'template_name': 'password_reset_complete.html'}, name='password_reset_complete'),
) )

View File

@ -21,7 +21,7 @@ class Migration(migrations.Migration):
('name_re', models.CharField(help_text='Blacklisted domain. Evaluated as regex (search).', unique=True, max_length=255)), ('name_re', models.CharField(help_text='Blacklisted domain. Evaluated as regex (search).', unique=True, max_length=255)),
('last_update', models.DateTimeField(auto_now=True)), ('last_update', models.DateTimeField(auto_now=True)),
('created', models.DateTimeField(auto_now_add=True)), ('created', models.DateTimeField(auto_now_add=True)),
('created_by', models.ForeignKey(related_name=u'blacklisted_domains', to=settings.AUTH_USER_MODEL)), ('created_by', models.ForeignKey(related_name=u'blacklisted_domains', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
], ],
options={ options={
}, },
@ -40,7 +40,7 @@ class Migration(migrations.Migration):
('comment', models.CharField(default=b'', max_length=255, null=True, help_text='Some arbitrary comment about your domain. If your domain is public, the comment will be also publicly shown.', blank=True)), ('comment', models.CharField(default=b'', max_length=255, null=True, help_text='Some arbitrary comment about your domain. If your domain is public, the comment will be also publicly shown.', blank=True)),
('last_update', models.DateTimeField(auto_now=True)), ('last_update', models.DateTimeField(auto_now=True)),
('created', models.DateTimeField(auto_now_add=True)), ('created', models.DateTimeField(auto_now_add=True)),
('created_by', models.ForeignKey(related_name=u'domains', to=settings.AUTH_USER_MODEL)), ('created_by', models.ForeignKey(related_name=u'domains', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
], ],
options={ options={
}, },
@ -68,8 +68,8 @@ class Migration(migrations.Migration):
('tls_update_ipv6', models.BooleanField(default=False)), ('tls_update_ipv6', models.BooleanField(default=False)),
('last_update', models.DateTimeField(auto_now=True)), ('last_update', models.DateTimeField(auto_now=True)),
('created', models.DateTimeField(auto_now_add=True)), ('created', models.DateTimeField(auto_now_add=True)),
('created_by', models.ForeignKey(related_name=u'hosts', to=settings.AUTH_USER_MODEL)), ('created_by', models.ForeignKey(related_name=u'hosts', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
('domain', models.ForeignKey(to='main.Domain')), ('domain', models.ForeignKey(to='main.Domain', on_delete=models.CASCADE)),
], ],
options={ options={
}, },
@ -84,7 +84,7 @@ class Migration(migrations.Migration):
('interface_id_ipv4', models.CharField(default=b'', help_text='The IPv4 interface ID of this host. Use IPv4 notation.', max_length=16)), ('interface_id_ipv4', models.CharField(default=b'', help_text='The IPv4 interface ID of this host. Use IPv4 notation.', max_length=16)),
('interface_id_ipv6', models.CharField(default=b'', help_text='The IPv6 interface ID of this host. Use IPv6 notation.', max_length=22)), ('interface_id_ipv6', models.CharField(default=b'', help_text='The IPv6 interface ID of this host. Use IPv6 notation.', max_length=22)),
('available', models.BooleanField(default=True, help_text="Check if host is available/in use - if not checked, we won't accept updates for this host")), ('available', models.BooleanField(default=True, help_text="Check if host is available/in use - if not checked, we won't accept updates for this host")),
('main_host', models.ForeignKey(related_name=u'relatedhosts', to='main.Host')), ('main_host', models.ForeignKey(related_name=u'relatedhosts', to='main.Host', on_delete=models.CASCADE)),
], ],
options={ options={
}, },
@ -103,7 +103,7 @@ class Migration(migrations.Migration):
('accept_ipv6', models.BooleanField(default=False)), ('accept_ipv6', models.BooleanField(default=False)),
('last_update', models.DateTimeField(auto_now=True)), ('last_update', models.DateTimeField(auto_now=True)),
('created', models.DateTimeField(auto_now_add=True)), ('created', models.DateTimeField(auto_now_add=True)),
('created_by', models.ForeignKey(related_name=u'serviceupdater', to=settings.AUTH_USER_MODEL)), ('created_by', models.ForeignKey(related_name=u'serviceupdater', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
], ],
options={ options={
}, },
@ -121,9 +121,9 @@ class Migration(migrations.Migration):
('give_ipv6', models.BooleanField(default=False)), ('give_ipv6', models.BooleanField(default=False)),
('last_update', models.DateTimeField(auto_now=True)), ('last_update', models.DateTimeField(auto_now=True)),
('created', models.DateTimeField(auto_now_add=True)), ('created', models.DateTimeField(auto_now_add=True)),
('created_by', models.ForeignKey(related_name=u'serviceupdaterhostconfigs', to=settings.AUTH_USER_MODEL)), ('created_by', models.ForeignKey(related_name=u'serviceupdaterhostconfigs', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
('host', models.ForeignKey(related_name=u'serviceupdaterhostconfigs', to='main.Host')), ('host', models.ForeignKey(related_name=u'serviceupdaterhostconfigs', to='main.Host', on_delete=models.CASCADE)),
('service', models.ForeignKey(to='main.ServiceUpdater')), ('service', models.ForeignKey(to='main.ServiceUpdater', on_delete=models.CASCADE)),
], ],
options={ options={
}, },

View File

@ -47,7 +47,7 @@ class Migration(migrations.Migration):
migrations.AlterField( migrations.AlterField(
model_name='blacklistedhost', model_name='blacklistedhost',
name='created_by', name='created_by',
field=models.ForeignKey(related_name='blacklisted_domains', verbose_name='created by', to=settings.AUTH_USER_MODEL), field=models.ForeignKey(related_name='blacklisted_domains', verbose_name='created by', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
preserve_default=True, preserve_default=True,
), ),
migrations.AlterField( migrations.AlterField(
@ -83,7 +83,7 @@ class Migration(migrations.Migration):
migrations.AlterField( migrations.AlterField(
model_name='domain', model_name='domain',
name='created_by', name='created_by',
field=models.ForeignKey(related_name='domains', verbose_name='created by', to=settings.AUTH_USER_MODEL), field=models.ForeignKey(related_name='domains', verbose_name='created by', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
preserve_default=True, preserve_default=True,
), ),
migrations.AlterField( migrations.AlterField(
@ -167,13 +167,13 @@ class Migration(migrations.Migration):
migrations.AlterField( migrations.AlterField(
model_name='host', model_name='host',
name='created_by', name='created_by',
field=models.ForeignKey(related_name='hosts', verbose_name='created by', to=settings.AUTH_USER_MODEL), field=models.ForeignKey(related_name='hosts', verbose_name='created by', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
preserve_default=True, preserve_default=True,
), ),
migrations.AlterField( migrations.AlterField(
model_name='host', model_name='host',
name='domain', name='domain',
field=models.ForeignKey(verbose_name='domain', to='main.Domain'), field=models.ForeignKey(verbose_name='domain', to='main.Domain', on_delete=models.CASCADE),
preserve_default=True, preserve_default=True,
), ),
migrations.AlterField( migrations.AlterField(
@ -269,7 +269,7 @@ class Migration(migrations.Migration):
migrations.AlterField( migrations.AlterField(
model_name='relatedhost', model_name='relatedhost',
name='main_host', name='main_host',
field=models.ForeignKey(related_name='relatedhosts', verbose_name='main host', to='main.Host'), field=models.ForeignKey(related_name='relatedhosts', verbose_name='main host', to='main.Host', on_delete=models.CASCADE),
preserve_default=True, preserve_default=True,
), ),
migrations.AlterField( migrations.AlterField(
@ -305,7 +305,7 @@ class Migration(migrations.Migration):
migrations.AlterField( migrations.AlterField(
model_name='serviceupdater', model_name='serviceupdater',
name='created_by', name='created_by',
field=models.ForeignKey(related_name='serviceupdater', verbose_name='created by', to=settings.AUTH_USER_MODEL), field=models.ForeignKey(related_name='serviceupdater', verbose_name='created by', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
preserve_default=True, preserve_default=True,
), ),
migrations.AlterField( migrations.AlterField(
@ -353,7 +353,7 @@ class Migration(migrations.Migration):
migrations.AlterField( migrations.AlterField(
model_name='serviceupdaterhostconfig', model_name='serviceupdaterhostconfig',
name='created_by', name='created_by',
field=models.ForeignKey(related_name='serviceupdaterhostconfigs', verbose_name='created by', to=settings.AUTH_USER_MODEL), field=models.ForeignKey(related_name='serviceupdaterhostconfigs', verbose_name='created by', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
preserve_default=True, preserve_default=True,
), ),
migrations.AlterField( migrations.AlterField(
@ -371,7 +371,7 @@ class Migration(migrations.Migration):
migrations.AlterField( migrations.AlterField(
model_name='serviceupdaterhostconfig', model_name='serviceupdaterhostconfig',
name='host', name='host',
field=models.ForeignKey(related_name='serviceupdaterhostconfigs', verbose_name='host', to='main.Host'), field=models.ForeignKey(related_name='serviceupdaterhostconfigs', verbose_name='host', to='main.Host', on_delete=models.CASCADE),
preserve_default=True, preserve_default=True,
), ),
migrations.AlterField( migrations.AlterField(
@ -401,7 +401,7 @@ class Migration(migrations.Migration):
migrations.AlterField( migrations.AlterField(
model_name='serviceupdaterhostconfig', model_name='serviceupdaterhostconfig',
name='service', name='service',
field=models.ForeignKey(verbose_name='service', to='main.ServiceUpdater'), field=models.ForeignKey(verbose_name='service', to='main.ServiceUpdater', on_delete=models.CASCADE),
preserve_default=True, preserve_default=True,
), ),
] ]

View File

@ -156,7 +156,7 @@ TEMPLATES = [
}, },
] ]
MIDDLEWARE_CLASSES = ( MIDDLEWARE = (
'django.middleware.common.CommonMiddleware', 'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware', 'django.middleware.locale.LocaleMiddleware',

View File

@ -19,9 +19,9 @@ WWW_IPV6_HOST = 'ip6-localhost:8000'
# ALLOWED_HOSTS is not needed here, as DEBUG is True # ALLOWED_HOSTS is not needed here, as DEBUG is True
MIDDLEWARE_CLASSES = ( MIDDLEWARE = (
'debug_toolbar.middleware.DebugToolbarMiddleware', 'debug_toolbar.middleware.DebugToolbarMiddleware',
) + MIDDLEWARE_CLASSES ) + MIDDLEWARE
INTERNAL_IPS = ['127.0.0.1', '::1', ] # needed for DebugToolbar! INTERNAL_IPS = ['127.0.0.1', '::1', ] # needed for DebugToolbar!
DEBUG_TOOLBAR_PATCH_SETTINGS = False DEBUG_TOOLBAR_PATCH_SETTINGS = False

View File

@ -29,7 +29,7 @@ urlpatterns = [
url(r'^accounts/', include('nsupdate.login.urls')), url(r'^accounts/', include('nsupdate.login.urls')),
# registration and user settings # registration and user settings
url(r'^account/', include('nsupdate.accounts.urls')), url(r'^account/', include('nsupdate.accounts.urls')),
url(r'^admin/', include(admin.site.urls)), url(r'^admin/', include((admin.site.get_urls(), 'admin'), namespace='admin')),
url(r'^i18n/', include('django.conf.urls.i18n')), url(r'^i18n/', include('django.conf.urls.i18n')),
url(r'^', include('nsupdate.main.urls')), url(r'^', include('nsupdate.main.urls')),
] ]

View File

@ -48,7 +48,7 @@ setup(
install_requires=[ install_requires=[
'dnspython', 'dnspython',
'netaddr', 'netaddr',
'django~=1.11.0', 'django',
'django-bootstrap-form', 'django-bootstrap-form',
'django-registration-redux', 'django-registration-redux',
'django-extensions', 'django-extensions',
@ -68,6 +68,7 @@ setup(
'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Internet :: Name Service (DNS)', 'Topic :: Internet :: Name Service (DNS)',
], ],
) )