Skip to content

Commit aae69f3

Browse files
authored
Make default_app_config conditional (#160)
1 parent 5d5c590 commit aae69f3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## [Unreleased]
44

5+
- Avoid Deprectaion Warnings for Django versions >= 3.2 [Changed in Django 3.2](https://docs.djangoproject.com/en/3.2/ref/applications/#for-application-authors)
6+
57
- Define `AppConfig.default_auto_field` as [required since Django 3.2](https://docs.djangoproject.com/en/3.2/releases/3.2/#customizing-type-of-auto-created-primary-keys).
68
- Upgrade PyYAML to v6.0
79

pattern_library/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
import django
2+
13
from .context_modifiers import register_context_modifier
24

3-
default_app_config = 'pattern_library.apps.PatternLibraryAppConfig'
5+
if django.VERSION < (3, 2):
6+
default_app_config = "pattern_library.apps.PatternLibraryAppConfig"
47

58
__all__ = [
69
'DEFAULT_SETTINGS',

0 commit comments

Comments
 (0)