From: Radek Czajka Date: Wed, 9 Jan 2019 13:18:53 +0000 (+0100) Subject: Django 2.1 X-Git-Url: https://git.mdrn.pl/cas.git/commitdiff_plain/d8e31144d930004a1c3758701e3267100be7f4ca?hp=1c1998bd8961dbe721b9e133811678c92fd3c685 Django 2.1 --- diff --git a/requirements.txt b/requirements.txt index 5f7fa3e..f64af1b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ -i https://py.mdrn.pl:8443/simple -Django>=1.8,<1.9 +Django>=2.1,<2.2 lxml>=2.2 django-gravatar2 Pillow --e git+https://github.com/rczajka/django-cas-provider.git@f3c49c09dc7b2a7ccee36b897b9056a9622e0c02#egg=django-cas-provider +-e git+https://github.com/fnp/django-cas-provider.git@fdbd98e576514c2a58183132369dccfb5781804a#egg=django-cas-provider diff --git a/src/accounts/tests.py b/src/accounts/tests.py index 2247054..e69de29 100644 --- a/src/accounts/tests.py +++ b/src/accounts/tests.py @@ -1,23 +0,0 @@ -""" -This file demonstrates two different styles of tests (one doctest and one -unittest). These will both pass when you run "manage.py test". - -Replace these with more appropriate tests for your application. -""" - -from django.test import TestCase - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.failUnlessEqual(1 + 1, 2) - -__test__ = {"doctest": """ -Another way to test that 1 + 1 is equal to 2. - ->>> 1 + 1 == 2 -True -"""} - diff --git a/src/cas/settings.py b/src/cas/settings.py index a4c4137..1883595 100644 --- a/src/cas/settings.py +++ b/src/cas/settings.py @@ -26,7 +26,7 @@ DATABASES = { # although not all choices may be available on all operating systems. # If running in a Windows environment this must be set to the same as your # system time zone. -TIME_ZONE = None +TIME_ZONE = 'UTC' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html @@ -98,12 +98,11 @@ INSTALLED_APPS = ( 'accounts', ) -MIDDLEWARE_CLASSES = ( +MIDDLEWARE = ( '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', ) diff --git a/src/cas/urls.py b/src/cas/urls.py index 9db4e41..2d44e70 100644 --- a/src/cas/urls.py +++ b/src/cas/urls.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from django.conf.urls import include, url +from django.urls import path, include from django.views.generic import RedirectView from django.contrib import admin from django.conf import settings @@ -7,23 +7,23 @@ from django.conf import settings admin.autodiscover() urlpatterns = [ - url(r'^$', RedirectView.as_view(url='/accounts/', permanent=False)), + path('', RedirectView.as_view(url='/accounts/', permanent=False)), # django-cas-provider - url(r'^cas/', include('cas_provider.urls')), + path('cas/', include('cas_provider.urls')), # Admin panel - url(r'^admin/doc/', include('django.contrib.admindocs.urls')), - url(r'^admin/', include(admin.site.urls)), + path('admin/doc/', include('django.contrib.admindocs.urls')), + path('admin/', admin.site.urls), - url(r'^accounts/', include('accounts.urls')), + path('accounts/', include('accounts.urls')), ] if settings.DEBUG: from django.views.static import serve urlpatterns += [ - url(r'^media/(?P.*)$', serve, { + path('media/', serve, { 'document_root': settings.MEDIA_ROOT, }), ]