development mode for web2py?

100 views
Skip to first unread message

firedragon852

unread,
Aug 14, 2010, 9:02:54 PM8/14/10
to web2py-users
I am doing development under windows so I am running the binary
version of web2py for windows.

It seems that whenever I change my code I need to clean/compile via
the admin interface for the changes to be effective.

Is there a way to turn this off? During development I want to be able
to make changes in the code (*.py and *.html), reload the web pages
and see the changes immediately.

I read the documentation many times but couldn't find any relevant
information on this. I also searched this group for clues but
couldn't find anything either.

mdipierro

unread,
Aug 15, 2010, 2:10:15 AM8/15/10
to web2py-users
You do not need to compile your application ever.

You only compile your app when you want to lock it and ship it in
closed source format.

The compilation step is not required for your app to work.

if you do not compile it your changes will be reflected immediately.

Massimo

DenesL

unread,
Aug 15, 2010, 9:58:27 AM8/15/10
to web2py-users
Hi firedragon852,

On Aug 14, 9:02 pm, firedragon852 <firedragon...@gmail.com> wrote:
> I am doing development under windows so I am running the binary
> version of web2py for windows.
>
> It seems that whenever I change my code I need to clean/compile via
> the admin interface for the changes to be effective.
>
> Is there a way to turn this off?  During development I want to be able
> to make changes in the code (*.py and *.html), reload the web pages
> and see the changes immediately.

Where are you changing your code?
*.py files changes in models? modules? controllers?
Modules might need a local_import.
Changes to *.html in views should be picked up immediately.

mart

unread,
Aug 15, 2010, 3:42:43 PM8/15/10
to web2py-users
Are you referring to the byte-compiled (.pyc) version of your code?
and that your changes to .py are not being picked up @ run time and
\the expected results are either lagging nor just plainly not showing
up? Are these your own modules that you are making reference to
outside of a controller's scope?

typically, even if foo.pyc if found living side by side with foo.py,
the time required to compile the .pyc is actually recoded and stamped
inside the .pyc. If a mismatch in the time taken to compile found,
then foo.pyc will be ignored, so in this sense compile errors, are not
necessarily a bad thing. I am no means a web2py expert, but i do use
Python quite a bit and while trying my hand web2py, I do make tones of
changes (mostly correcting mistakes ;) ), and .pyc don't get
generated @ dev time. I wonder if there may be a call to force compile
your .py files? But regardless, I would investigate outside of the
web2py environment to isolate the pure python calls of your code from
wev2py (something i do every now and again - specially when I know
that the issue is in my own modules that I import)

if this is in fact the case, python.org does have a good section on
modules

http://docs.python.org/release/2.2.3/tut/node8.html#SECTION008410000000000000000

Hope it helps,

Mart :)

mdipierro

unread,
Aug 16, 2010, 12:06:25 AM8/16/10
to web2py-users
I think it is much simpler than people assume here. I have seen many
users not Python experts, comeing from compiled languages, they click
on [bytecode compile] at every change. That is not necessary here.
That is a optional locking mechanism not a required step.

On 15 Ago, 21:42, mart <msenecal...@gmail.com> wrote:
> Are you referring to the byte-compiled (.pyc) version of your code?
> and that your changes to .py are not being picked up @ run time and
> \the expected results are either lagging nor just plainly not showing
> up?  Are these your own modules that you are making reference to
> outside of a controller's scope?
>
> typically, even if foo.pyc if found living side by side with foo.py,
> the time required to compile the .pyc is actually recoded and stamped
> inside the .pyc. If a mismatch in the time taken to compile found,
> then foo.pyc will be ignored, so in this sense compile errors, are not
> necessarily a bad thing. I am no means a web2py expert, but i do use
> Python quite a bit and while trying my hand web2py, I do make tones of
> changes (mostly correcting mistakes ;) ),  and .pyc don't get
> generated @ dev time. I wonder if there may be a call to force compile
> your .py files? But regardless, I would investigate outside of the
> web2py environment to isolate the pure python calls of your code from
> wev2py (something i do every now and again - specially when I know
> that the issue is in my own modules that I import)
>
> if this is in fact the case, python.org does have a good section on
> modules
>
> http://docs.python.org/release/2.2.3/tut/node8.html#SECTION0084100000...
>
> Hope it helps,
>
> Mart :)
>
> On Aug 15, 9:58 am, DenesL <denes1...@yahoo.ca> wrote:
>
>
>
> > Hi firedragon852,
>
> > On Aug 14, 9:02 pm, firedragon852 <firedragon...@gmail.com> wrote:
>
> > > I am doing development under windows so I am running the binary
> > > version of web2py for windows.
>
> > > It seems that whenever I change my code I need to clean/compile via
> > > the admin interface for the changes to be effective.
>
> > > Is there a way to turn this off?  During development I want to be able
> > > to make changes in the code (*.py and *.html), reload the web pages
> > > and see the changes immediately.
>
> > Where are you changing your code?
> > *.py files changes in models? modules? controllers?
> > Modules might need a local_import.
> > Changes to *.html in views should be picked up immediately.
>
> > > I read the documentation many times but couldn't find any relevant
> > > information on this.  I also searched this group for clues but
> > > couldn't find anything either.- Nascondi testo citato
>
> - Mostra testo citato -

firedragon852

unread,
Aug 16, 2010, 9:27:01 PM8/16/10
to web2py-users
You are right. It is actually very simple after reading your hints.
Thanks for a great web framework!
Reply all
Reply to author
Forward
0 new messages