Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit 7349090

Browse files
tomkinsashwoods
authored andcommitted
Fix initialize import for Django < 1.7
Fixes #1013 (honest!)
1 parent d796576 commit 7349090

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

raven/contrib/django/__init__.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@
77
"""
88
from __future__ import absolute_import
99

10-
import django
11-
1210
default_app_config = 'raven.contrib.django.apps.RavenConfig'
1311

1412
from .client import DjangoClient # NOQA
15-
16-
# Django 1.8 uses ``raven.contrib.apps.RavenConfig``
17-
if django.VERSION < (1, 7, 0):
18-
from .models import initialize
19-
initialize()

raven/contrib/django/models.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import sys
1616
import warnings
1717

18+
import django
1819
from django.conf import settings
1920
from django.core.signals import got_request_exception, request_started
2021
from threading import Lock
@@ -270,3 +271,7 @@ def initialize():
270271
get_client() # NOQA
271272
except Exception:
272273
_initialized = False
274+
275+
# Django 1.8 uses ``raven.contrib.apps.RavenConfig``
276+
if django.VERSION < (1, 7, 0):
277+
initialize()

0 commit comments

Comments
 (0)