0

I'm changing a .py file which runs part of a Twisted environment. However the update is not reflected when the script runs.

I did these steps to no avail: a. touched the wsgi file, b. restarted apache, c. deleted the corresponding .pyc file.

Any light someone could shed would be super! Thanks.

3
  • 1
    What is a "Twisted environment"? What "part" of it is this .py file? How is WSGI involved (what is "the wsgi file")? Twisted is not a WSGI application, nor is it compatible with Apache in any typical way. It's hard to tell what you're trying to do. Commented Sep 14, 2012 at 15:37
  • The Django app uses Twisted. Django runs via Apache using WSGI. Not sure what else you want me to say? Commented Sep 14, 2012 at 15:41
  • 1
    That clarifies things somewhat, but unfortunately doesn't help reveal the problem. Perhaps the Django application is importing the module from a different location on the filesystem than you are modifying? Or perhaps it is loading your modified code, but your modifications don't have the observable consequence you were expecting. Also make sure you saved your buffer so the changes are really written to the source file. I'm aware these all sound very obvious, but it's the best I can do. A more advanced approach might be to strace Apache to see what files it tries to read and when. Commented Sep 14, 2012 at 17:08

1 Answer 1

1

Nobody can really say. There isn't enough detail in the question.

One possible problem is that your Django app that "uses Twisted" does so by running Twisted in a subprocess or a separate process. Maybe your Apache stuff is re-running your whole Django script but there's a Twisted process off on the side that keeps running?

Alternately, maybe some part of your deployment infrastructure is calling reload() on your Django modules but Twisted is in some other thread and therefore not affected by that?

(Please consider attaching an SSCCE to this in order to give respondents something to go off of.)

Sign up to request clarification or add additional context in comments.

1 Comment

Yes thank you. It was another process that Twisted was running it. It also needed a restart.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.