Python will create a .pyc file for any module (same for modules in web2py). However, unlike in Django, web2py model and controller files are not Python modules. Instead, they are executed by the framework. The advantage is that changes are active immediately, without needing to restart the web server. Of course, you can compile the web2py model and controller files, but you must do that as an explicit step (usually only in production once you have finalized the code). Note, when you compile a web2py application (which you can do in the admin interface), it also compiles the views, not just models and controllers.
Anthony On Sunday, November 17, 2013 3:02:02 AM UTC-5, 黄祥 wrote: > > hi, > > just wondering, why web2py didn't have auto compiled like in django? > e.g. everytime create the new python file in django and then execute it > (cli or browser), i observe that django always create the *.pyc (python > compiled) for the file that executed. > honestly, i don't know what exactly happen in the django background > process, but i assume that django auto compiled the python file so that the > *.pyc file generated. > yet in the book about development recipes said to bytecode compile the > app, so why web2py didn't adopt auto compiled like in django? > > please correct me if i'm wrong. > > ref: > > http://web2py.com/books/default/chapter/29/13/deployment-recipes#Efficiency-tricks > > best regards, > stifan > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.