As far as I know Django imports.

When you say "The uploaded *.pyc will not load on app engine for
security reasons." do you refer to the gluon modules or also to the
app/compiled/*.pyc?

The latter should work, exactly because we bypass the normal import.

Massimo


On Oct 18, 6:35 pm, Robin B <[EMAIL PROTECTED]> wrote:
> The uploaded *.pyc will not load on app engine for security reasons.
>
> I am not sure how Django handles it, does Django use import or exec?
>
> Modules that are imported get compiled and reused, but web2py uses
> exec to mixin symbols which bypasses the regular import mechanism.
>
> Putting the compiled source into a dict will cut the read, parse,
> compile churn.
>
> Robin
>
> On Oct 18, 5:55 pm, mdipierro <[EMAIL PROTECTED]> wrote:
>
> > Robin,
>
> > is it sufficient to byte-code compile the app and make sure the pyc
> > files (including gluon/*.pyc) are uploaded too or do we need to modify
> > web2py?
>
> > Massimo
>
> > On Oct 18, 5:28 pm, yarko <[EMAIL PROTECTED]> wrote:
>
> > > Sorry - I don't know about *.pyc files;  I assume they're not platform
> > > dependent, so I'm assuming that uploading *.pyc files with your app
> > > doesn't work (?).
>
> > > How is the Django support on GAE handling this issue?
>
> > > On Oct 18, 1:51 pm, Robin B <[EMAIL PROTECTED]> wrote:
>
> > > > In compileapp.py, after reading, parsing, and compiling a model, view,
> > > > or controller, if a .pyc cannot be written to disk, instead store the
> > > > compiled code, by file name/function, in a global dict so that next
> > > > request you can simply load the precompiled code directly from RAM.
>
> > > > Since web2py does not have an environment (does not distinguish
> > > > between development and production etc), the only way to update the
> > > > cached code is to check the mtime of each file on every request which
> > > > is wasteful in production where the code does not change, but not
> > > > nearly as wasteful as repeatedly reading, parsing and compiling.
>
> > > > Robin
>
> > > > On Oct 18, 10:27 am, mdipierro <[EMAIL PROTECTED]> wrote:
>
> > > > > On Oct 18, 9:51 am, Robin B <[EMAIL PROTECTED]> wrote:
>
> > > > > > Web2py 'works' on appengine, but it is reading, parsing and 
> > > > > > compiling
> > > > > > the models, controllers, and views on *every* request causing all 
> > > > > > the
> > > > > > wasted CPU cycles.  Normally, web2py caches code as .pyc files, but
> > > > > > you cannot write the filesystem on appengine so nothing gets cached 
> > > > > > by
> > > > > > default.  It is trivial to cache the compiled code in a dict and 
> > > > > > reuse
> > > > > > it on the next request.
>
> > > > > Could you explain more?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to