[web2py] Compile from command line

439 views
Skip to first unread message

Mike Veltman

unread,
Aug 28, 2011, 9:05:11 PM8/28/11
to web...@googlegroups.com

Its pretty annoying because I did know it before.

Does anybody know what the command is to compile from the command line ?

Also is there are website or part of the book that will collect this so I can
add it ?

Thanks in advance.

With regards,
Mike Veltman


Anthony

unread,
Aug 28, 2011, 9:42:17 PM8/28/11
to web...@googlegroups.com
All the functions available in the 'admin' app are available in /gluon/admin.py for command line use. The function for compiling the app is app_compile(app, request), which in turn calls gluon.compileapp.compile_application. I don't think this is documented in the book.

Anthony

Bruno Rocha

unread,
Aug 28, 2011, 9:44:34 PM8/28/11
to web...@googlegroups.com
here: http://thadeusb.com/weblog/2010/4/21/compile_web2py_apps_externally


python -c "import gluon.compileapp; gluon.compileapp.compile_application('applications/<appname>')"

--



--
Bruno Rocha
[ Aprenda a programar: http://CursoDePython.com.br ]
[ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
[ Consultoria em desenvolvimento web: http://www.blouweb.com ]

Bruno Rocha

unread,
Aug 28, 2011, 9:48:44 PM8/28/11
to web...@googlegroups.com
On Sun, Aug 28, 2011 at 10:42 PM, Anthony <abas...@gmail.com> wrote:
All the functions available in the 'admin' app are available in /gluon/admin.py for command line use. The function for compiling the app is app_compile(app, request), which in turn calls gluon.compileapp.compile_application. I don't think this is documented in the book.

All Thadeus articles from here: http://thadeusb.com/weblog/category/Web2py Should go somewhere in the book! 

Mike Veltman

unread,
Aug 28, 2011, 10:40:58 PM8/28/11
to web...@googlegroups.com
> here: http://thadeusb.com/weblog/2010/4/21/compile_web2py_apps_externally
>
> python -c "import gluon.compileapp;
> gluon.compileapp.compile_application('applications/<appname>')"
>
> On Sun, Aug 28, 2011 at 10:05 PM, Mike Veltman
<mike.v...@gmail.com>wrote:
> > Its pretty annoying because I did know it before.
> >
> > Does anybody know what the command is to compile from the command line ?
> >
> > Also is there are website or part of the book that will collect this so I
> > can
> > add it ?
> >
> > Thanks in advance.
> >
> >
> >
> > With regards,
> > Mike Veltman


That was it ! thanks :)

With regards,
Mike Veltman


Thomas Bellembois

unread,
Sep 5, 2011, 5:15:51 AM9/5/11
to web...@googlegroups.com
Le 29/08/2011 04:40, Mike Veltman a �crit :
Sorry for this basic question about compiled apps: do we have to run
web2py in a different way with a compiled app ? or does web2py detect
that there is a compiled version ?

Regards,

Thomas

Anthony

unread,
Sep 5, 2011, 11:25:01 PM9/5/11
to web...@googlegroups.com
On Monday, September 5, 2011 5:15:51 AM UTC-4, Thomas Bellembois wrote:

Sorry for this basic question about compiled apps: do we have to run
web2py in a different way with a compiled app ? or does web2py detect
that there is a compiled version ?

No, just run as usual -- web2py will figure it out.

Side note: One thing that doesn't work with compiling is an {{include var}} statement in a view, where 'var' is a variable. When views are compiled, all the includes are handled at compile time, and because the value of 'var' isn't known at compile time, the view cannot be compiled properly.

Anthony
Reply all
Reply to author
Forward
0 new messages