Skip to content

Commit 0a0b46c

Browse files
committed
fixed "RemovedInDjango110Warning..." warnings
1 parent 050e409 commit 0a0b46c

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

example/settings.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@
3030
os.path.join(os.path.dirname(__file__), 'templates'),
3131
)
3232

33+
TEMPLATES = [
34+
{
35+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
36+
'DIRS': [
37+
os.path.join(os.path.dirname(__file__), 'templates'),
38+
],
39+
'APP_DIRS': True,
40+
},
41+
]
42+
3343
# Application definition
3444

3545
PROJECT_APPS = [

example/urls.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from django.conf.urls import url
22

3+
from .views import index
4+
35
urlpatterns = [
4-
url(r'^$', 'index'),
5-
url(r'^ignored/$', 'index'),
6+
url(r'^$', index),
7+
url(r'^ignored/$', index),
68
]

maintenancemode/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def test_disabled_middleware(self):
6868
def test_enabled_middleware_without_template(self):
6969
# Enabling the middleware without a proper 503 template should
7070
# raise a template error
71-
with self.settings(MAINTENANCE_MODE=True, TEMPLATE_DIRS=[]):
71+
with self.settings(MAINTENANCE_MODE=True, TEMPLATE_DIRS=[], TEMPLATES=[]):
7272
self.assertRaises(TemplateDoesNotExist, self.client.get, '/')
7373

7474
def test_enabled_middleware_with_template(self):

0 commit comments

Comments
 (0)