Skip to content

Commit

Permalink
Change __import__ usage to to be import_module, adjust test reqs to s…
Browse files Browse the repository at this point in the history
…pecify >= 1.1,< 1.4, and add note about required Django version
  • Loading branch information
dcramer committed May 27, 2011
1 parent 34d0328 commit c61daab
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ There is also one Django management command currently:

If you have ideas for other panels please let us know.

* Note: The Debug Toolbar only works on Django 1.1 and newer.

Installation
============

Expand Down
3 changes: 2 additions & 1 deletion debug_toolbar/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.utils.encoding import smart_unicode
from django.utils.importlib import import_module

import debug_toolbar.urls
from debug_toolbar.toolbar.loader import DebugToolbar
Expand Down Expand Up @@ -79,7 +80,7 @@ def process_request(self, request):

urlconf = getattr(request, 'urlconf', settings.ROOT_URLCONF)
if isinstance(urlconf, basestring):
urlconf = __import__(getattr(request, 'urlconf', settings.ROOT_URLCONF), {}, {}, ['*'])
urlconf = import_module(getattr(request, 'urlconf', settings.ROOT_URLCONF))

if urlconf not in self._urlconfs:
new_urlconf = imp.new_module('urlconf')
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
license='BSD',
packages=find_packages(exclude=['ez_setup']),
tests_require=[
'django',
'django>=1.1,<1.4',
'dingus',
],
test_suite='debug_toolbar.runtests.runtests',
Expand Down

0 comments on commit c61daab

Please sign in to comment.