diff --git a/AUTHORS b/AUTHORS
index 4921f7c..67d6a47 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -510,6 +510,8 @@ answer newbie questions, and generally made Django that much better:
     Cheng Zhang
     Glenn Maynard <glenn@zewt.org>
     bthomas
+    Chris Lamb <lamby@debian.org>
+    Pascal Hartig <phartig@rdrei.net>
 
 A big THANK YOU goes to:
 
diff --git a/django/utils/autoreload.py b/django/utils/autoreload.py
index 8d9d6f2..3eb02b1 100644
--- a/django/utils/autoreload.py
+++ b/django/utils/autoreload.py
@@ -28,7 +28,7 @@
 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-import os, sys, time
+import os, sys, time, datetime
 
 try:
     import thread
@@ -42,19 +42,81 @@ try:
 except ImportError:
     pass
 
+USE_INOTIFY = False
+try:
+    # Test whether inotify is enabled and likely to work
+    import pyinotify
+
+    fd = pyinotify.LIBC.inotify_init()
+    if fd != -1:
+        USE_INOTIFY = True
+        os.close(fd)
+except ImportError:
+    pass
 
 RUN_RELOADER = True
 
 _mtimes = {}
 _win = (sys.platform == "win32")
+_last_update = None
 
-def code_changed():
-    global _mtimes, _win
+
+def gen_filenames():
+    """
+    Yields a generator over filenames  referenced in
+    sys.modules.
+    """
     for filename in filter(lambda v: v, map(lambda m: getattr(m, "__file__", None), sys.modules.values())):
         if filename.endswith(".pyc") or filename.endswith(".pyo"):
             filename = filename[:-1]
         if not os.path.exists(filename):
             continue # File might be in an egg, so it can't be reloaded.
+
+        yield filename
+
+
+def inotify_code_changed():
+    """
+    Checks for changed code using inotify.  After being called
+    it blocks until a change event has been fired.
+    """
+    wm = pyinotify.WatchManager()
+    notifier = pyinotify.Notifier(wm)
+    min_update_interval = datetime.timedelta(seconds=1)
+
+    def update_watch(sender=None, **kwargs):
+        global _last_update
+
+        if _last_update is not None and \
+                datetime.datetime.now() - _last_update < min_update_interval:
+            return
+
+        _last_update = datetime.datetime.now()
+
+        mask = pyinotify.IN_MODIFY \
+             | pyinotify.IN_DELETE \
+             | pyinotify.IN_ATTRIB \
+             | pyinotify.IN_MOVED_FROM \
+             | pyinotify.IN_MOVED_TO \
+             | pyinotify.IN_CREATE
+
+        for path in gen_filenames():
+            wm.add_watch(path, mask)
+
+    from django.core.signals import request_finished
+    request_finished.connect(update_watch)
+    update_watch()
+
+    # Block forever
+    notifier.check_events(timeout=None)
+    notifier.stop()
+
+    # If we are here the code must have changed.
+    return True
+
+def code_changed():
+    global _mtimes, _win
+    for filename in gen_filenames():
         stat = os.stat(filename)
         mtime = stat.st_mtime
         if _win:
@@ -68,8 +130,13 @@ def code_changed():
     return False
 
 def reloader_thread():
+    if USE_INOTIFY:
+        fn = inotify_code_changed
+    else:
+        fn = code_changed
+
     while RUN_RELOADER:
-        if code_changed():
+        if fn():
             sys.exit(3) # force reload
         time.sleep(1)
 
