Search code examples
pythondjangotwisted

Can twistd do an automatic server reset the same way as django?


One of the things I really like about django is the way the server automatically resets when you edit the project. I've recently started doing some development in twisted/cyclone.

Is there a similar way to make twistd reset automatically when a program file is changed?


Solution

  • You can use inotify - it enables monitoring filesystem events, such as file modification. There are also python bindings: pyinotify There are many tutorials there, my suggestion is that you implement a wrapper that starts twisted monitors you source path. When a file modification occurs you restart twisted.