Changeset 1278 for trunk/locker


Ignore:
Timestamp:
Jul 25, 2009, 1:34:06 AM (15 years ago)
Author:
mitchb
Message:
Make Django autoreloads actually work, without even touching index.fcgi
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/locker/deploy/bin/django

    r1222 r1278  
    1616print FASTCGI <<EOF;
    1717#!/usr/bin/env python
    18 import sys, os
     18import sys, os, time, threading, django.utils.autoreload
    1919sys.path.insert(0, "/mit/$USER/Scripts/django")
    2020os.chdir("/mit/$USER/Scripts/django/$name")
    2121os.environ['DJANGO_SETTINGS_MODULE'] = "$name.settings"
     22
     23def reloader_thread():
     24    while True:
     25        if django.utils.autoreload.code_changed():
     26            os._exit(3)
     27        time.sleep(1)
     28t = threading.Thread(target=reloader_thread)
     29t.daemon = True
     30t.start()
    2231
    2332from django.core.servers.fastcgi import runfastcgi
Note: See TracChangeset for help on using the changeset viewer.