File tree 3 files changed +13
-12
lines changed
3 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ def handle(self, **options):
69
69
tpl_dirs = app_template_dirs + DIRS
70
70
else :
71
71
tpl_dirs = DIRS + app_template_dirs
72
- templatedirs = [d for d in tpl_dirs if os .path .isdir (d )]
72
+ templatedirs = [str ( d ) for d in tpl_dirs if os .path .isdir (d )]
73
73
74
74
for templatedir in templatedirs :
75
75
for dirpath , subdirs , filenames in os .walk (templatedir ):
Original file line number Diff line number Diff line change
1
+ import django
1
2
from django .core import signals
2
3
from django .contrib .sites .models import Site
3
4
from django .template .defaultfilters import slugify
@@ -9,8 +10,12 @@ def get_cache_backend():
9
10
"""
10
11
Compatibilty wrapper for getting Django's cache backend instance
11
12
"""
12
- from django .core .cache import _create_cache
13
- cache = _create_cache (settings .DBTEMPLATES_CACHE_BACKEND )
13
+ if django .VERSION [0 ] >= 3 and django .VERSION [1 ] >= 2 :
14
+ from django .core .cache import caches
15
+ cache = caches .create_connection (settings .DBTEMPLATES_CACHE_BACKEND )
16
+ else :
17
+ from django .core .cache import _create_cache
18
+ cache = _create_cache (settings .DBTEMPLATES_CACHE_BACKEND )
14
19
# Some caches -- python-memcached in particular -- need to do a cleanup at
15
20
# the end of a request cycle. If not implemented in a particular backend
16
21
# cache.close is a no-op
Original file line number Diff line number Diff line change @@ -4,21 +4,18 @@ usedevelop = True
4
4
minversion = 1.8
5
5
envlist =
6
6
flake8
7
- py{35,36}-dj111
8
- py{35,36,37}-dj21
9
- py{35,36,37,38,39}-dj22
7
+ py3{6,7,8,9}-dj22
8
+ py3{6,7,8,9}-dj3{1,2}
10
9
11
10
[gh-actions]
12
11
python =
13
- 3.5: py36
14
12
3.6: py36
15
13
3.7: py37
16
14
3.8: py38, flake8
17
15
3.9: py39
18
16
19
17
[testenv]
20
18
basepython =
21
- py35: python3.5
22
19
py36: python3.6
23
20
py37: python3.7
24
21
py38: python3.8
@@ -28,10 +25,9 @@ setenv =
28
25
DJANGO_SETTINGS_MODULE = dbtemplates.test_settings
29
26
deps =
30
27
-r requirements/tests.txt
31
- dj111: Django<2.0
32
- dj20: Django<2.1
33
- dj21: Django<2.2
34
28
dj22: Django<2.3
29
+ dj31: Django<3.2
30
+ dj32: Django<3.3
35
31
djmain: https://github.com/django/django/archive/main.tar.gz# egg=django
36
32
37
33
commands =
@@ -41,7 +37,7 @@ commands =
41
37
coverage xml
42
38
43
39
[testenv:flake8]
44
- basepython = python3.8
40
+ basepython = python3.9
45
41
commands = flake8 dbtemplates
46
42
deps = flake8
47
43
You can’t perform that action at this time.
0 commit comments