views:

27

answers:

1

Whenever I change my python source files in my Django project, the .pyc files become out of date. Of course that's because I need to recompile them in order to test them through my local Apache web server. I would like to get around this manual process by employing some automatic means of compiling them on save, or on build through Eclipse, or something like that. What's the best and proper way to do this?

+2  A: 

You shouldn't ever need to 'compile' your .pyc files manually. This is always done automatically at runtime by the Python interpreter.

In rare instances, such as when you delete an entire .py module, you may need to manually delete the corresponding .pyc. But there's no need to do any other manual compiling.

What makes you think you need to do this?

Daniel Roseman
Isn't this more of a Django requirement? I would make changes to the python source files (.py)... and the compiled python files (.pyc) wouldn't be updated. So, when I would to my django web site, which would then execute/run the wsgi django app, it would read the old .pyc files instead of recompiling the .py files.
Sean Ochoa
I suspect this isn't anything to do with .pyc files being out of date. It is simply that you need to restart the WSGI server when you make any code changes.
Daniel Roseman