Permalink
Browse files

Use importlib instead of imp.

This allows DJANGO_SETTINGS_MODULE with dots, for example
DJANGO_SETTINGS_MODULE=sites.dev.settings_mkt
  • Loading branch information...
1 parent a751dc6 commit 96ff40f1a920775a4eeaa29a1117567679ffdb56 @oremj oremj committed Dec 19, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 manage.py
View
@@ -1,5 +1,4 @@
#!/usr/bin/env python
-import imp
import logging
import os
import site
@@ -64,8 +63,8 @@
setting = 'settings_local'
# Finally load the settings file that was specified.
-res = imp.find_module(setting)
-settings = imp.load_module(setting, *res)
+from django.utils import importlib
+settings = importlib.import_module(setting)
os.environ['DJANGO_SETTINGS_MODULE'] = setting
if not settings.DEBUG:

0 comments on commit 96ff40f

Please sign in to comment.