[web2py] How to implement background task getting GPS data requested on demand by the web client

2016-04-13 Thread Georges Vidal
HI

I work on a project based on Python and PCDUINO plateform.

I would like to use web2py framework to simplify the web communication 
between the client and server.

*The process to implement in a few words is :*

*On the server side :* Define a python process that every 0.5 second asks 
the gpsd daemon to retreive the GPS position of my car. Some calculations 
are done during this process, so this job must be in a loop in parallel of 
all other process.

*On the client side :* (a browser in the car), I would like that the client 
ask the server every second to get the position and results of calculations 
and display them on the html page. I assume Ajax or cookies can to be use 
to refresh only a part of the screen.


So, my question is, how to implement such architecture ? Is framework 
mandatory? 

I know how to code the server process but not to make in parallel the 
client process and make them to communicate to each other.

Must I have to create a // server process getting data from GPS, doing 
calculations twice per second and storing the result somewhere accessible 
by the framework (i.e. database or cookies) ?
If I use your framework to create web UI and every second read the server 
results, is it possible to put a loop somewhere in the Framework code to 
put everything in one place rather that on process to run calculation and 
one for the framework ?

If the first solution is retained, what is the best support to store data 
(one row of about 30 fields, about 100 octets). Saying that I am not sure 
that storing into sqlite database is the best, cookie or sessions may be 
would be better ?

So, any information advice would be appreciated.


Best regards

Georges 

-- 
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/d/optout.


[web2py] Background process

2016-04-13 Thread Georges Vidal
HI

I work on a project based on Python and PCDUINO plateform.

I would like to use web2py framework to simplify the web communication 
between the client and server.

The process to implement in a few words is :

On the server side : Define a python process that every 0.5 second asks the 
gpsd daemon to retreive the GPS position of my car. Some calculations are 
done during this process, so this job must be in a loop in parallel of all 
other process.

On the client side : (a browser in the car), I would like that the client 
ask the server every second to get the position and results of calculations 
and display them on the html page. I assume Ajax or cookies can to be use 
to refresh only a part of the screen.


So, my question is, how to implement such architecture ? Is framework 
mandatory? 

I know how to code the server process but not to make in parallel the 
client process and make them to communicate to each other.

Must I have to create a // server process getting data from GPS, doing 
calculations twice per second and storing the result somewhere accessible 
by the framework (i.e. database or cookies) ?
If I use your framework to create web UI and every second read the server 
results, is it possible to put a loop somewhere in the Framework code to 
put everything in one place rather that on process to run calculation and 
one for the framework ?

If the first solution is retained, what is the best support to store data 
(one row of about 30 fields, about 100 octets). Saying that I am not sure 
that storing into sqlite database is the best, cookie or sessions may be 
would be better ?

So, any information advice would be appreciated.


Best regards

Georges 

-- 
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/d/optout.


Re: [web2py] Re: web2py 2.14.4 is OUT

2016-04-13 Thread Richard Vézina
I didn't have time to investigate though it won't start with :

python web2py.py -S welcome -M

But once it has been started with the launcher :

python web2py.py

It start with the previous command...

To reproduce, unzip 2.14.4 and try the first command.

Richard



On Wed, Apr 13, 2016 at 5:31 PM, Dave S  wrote:

>
>
> On Wednesday, April 13, 2016 at 1:41:12 PM UTC-7, Alex Glaros wrote:
>>
>> was this below left out of layout.html?  I just see the word "include"
>> there but nothing to include
>>
>> {{block header}}
>> 
>>   
>> {{if response.title:}}
>> {{=response.title}}
>>   {{=response.subtitle or ''}}
>> {{pass}}
>>   
>> 
>> {{end}}
>>
>> thanks,
>>
>> Alex Glaros
>>
>
>
>
> Layout.html didn't change.  This comes from
> welcome/views/default/index.html.
>
> /dps
>
>
> --
> 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/d/optout.
>

-- 
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/d/optout.


[web2py] Re: Empty strings stored as null in database

2016-04-13 Thread Leonel Câmara
Ok I've fixed it:
https://github.com/web2py/web2py/pull/1294

And now I hate you guys with a tremendous passion. It took me a huge amount 
of time for a fix that ended up being a oneliner.

html.py is horrible, Cthulhu level horrible, it couldn't be harder to 
follow its execution flow if it had goto statements and afterwards you 
minified it.

To understand the bug first you need to look at the _validate method of the 
INPUT helper.

Then you also need sqlhtml.py and see that it sets some default validators

Then look dal.py where those defaults are defined (no it's not inside the 
pydal package)

Then you need to really understand the IS_EMPTY_OR validator which 
thankfully I do because I have been making tests for validators.

Someone please contribute to the book how important the null argument is to 
IS_EMPTY_OR because otherwise you're getting a None which will be a NULL in 
the database since IS_EMPTY_OR doesn't know what kind of field it's dealing 
with.




-- 
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/d/optout.


[web2py] Re: missing response.title and subtitle

2016-04-13 Thread Dave S


On Wednesday, April 13, 2016 at 4:44:27 PM UTC-7, Dave S wrote:
>
>
>
> On Wednesday, April 13, 2016 at 3:47:38 PM UTC-7, Alex Glaros wrote:
>>
>> that works as I expected,but didn't we not have to copy index.html to 
>> newfunc.html?  
>>
>> we used to just use admin button to "create new view" and mast header 
>> code was automatically included.  I mean we had to have {{extend 
>> 'layout.html'}} in the view, and that was all that was needed to get 
>> headers in the new view.
>>
>
>
> Poking around on git, this doesn't seem to have changed since 2013.
>
> Create view on 2.14.4 makes what is basically a placeholder, with extend, 
> h1, beautify().That doesn't surprise me, because views are 
> opportunities to customize.  It looks like 2.11.2 did the same:   This very 
> minimal view is created in applications/admin/controllers/default.py. 
>
> I'm not how quickly I access the 2.4.x version web2py I first used.
>
>
FWIW, my oldest app (created under 2.4.x) did have the 
banner/title/subtitle stuff in layout.html, and not in default/index.html. 
 It kept working under most updates, so I didn't pay attention, and the 
later apps mostly started with the newer welcome.

/dps

 

-- 
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/d/optout.


[web2py] Re: sequential requests

2016-04-13 Thread Jason Solack
Quick update on this... I ran the same test with nginx on aws and that works as 
expected... So I strongly suspect a setting or settings in Apache being the 
issue

-- 
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/d/optout.


[web2py] Re: missing response.title and subtitle

2016-04-13 Thread Dave S


On Wednesday, April 13, 2016 at 3:47:38 PM UTC-7, Alex Glaros wrote:
>
> that works as I expected,but didn't we not have to copy index.html to 
> newfunc.html?  
>
> we used to just use admin button to "create new view" and mast header code 
> was automatically included.  I mean we had to have {{extend 'layout.html'}} 
> in the view, and that was all that was needed to get headers in the new 
> view.
>


Poking around on git, this doesn't seem to have changed since 2013.

Create view on 2.14.4 makes what is basically a placeholder, with extend, 
h1, beautify().That doesn't surprise me, because views are 
opportunities to customize.  It looks like 2.11.2 did the same:   This very 
minimal view is created in applications/admin/controllers/default.py. 

I'm not how quickly I access the 2.4.x version web2py I first used.

/dps





 

-- 
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/d/optout.


[web2py] Re: missing response.title and subtitle

2016-04-13 Thread Dave S


On Wednesday, April 13, 2016 at 3:47:38 PM UTC-7, Alex Glaros wrote:
>
> that works as I expected,but didn't we not have to copy index.html to 
> newfunc.html?  
>
> we used to just use admin button to "create new view" and mast header code 
> was automatically included.  I mean we had to have {{extend 'layout.html'}} 
> in the view, and that was all that was needed to get headers in the new 
> view.
>


 

-- 
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/d/optout.


[web2py] Re: missing response.title and subtitle

2016-04-13 Thread Alex Glaros
that works as I expected,but didn't we not have to copy index.html to 
newfunc.html?  

we used to just use admin button to "create new view" and mast header code 
was automatically included

-- 
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/d/optout.


[web2py] Re: missing response.title and subtitle

2016-04-13 Thread Dave S


On Wednesday, April 13, 2016 at 3:30:07 PM UTC-7, Alex Glaros wrote:
>
> it works for me like that too but can you please try a new function not 
> named index.html?
>
> the reason I'm posting is because I get the same behaviour on two 
> different computers.
>
> much appreciated!
>
> Alex
>

newfunc() behaves exactly like index(), which isn't surprising ... I block 
copied the python code within default.py, and I copied 
views/default/index.html to views/default/newfunc.html.


/dps

-- 
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/d/optout.


[web2py] Re: missing response.title and subtitle

2016-04-13 Thread Alex Glaros
it works for me like that too but can you please try a new function not 
named index.html?

the reason I'm posting is because I get the same behaviour on two different 
computers.

much appreciated!

Alex

-- 
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/d/optout.


[web2py] Re: missing response.title and subtitle

2016-04-13 Thread Dave S


On Wednesday, April 13, 2016 at 2:47:56 PM UTC-7, Alex Glaros wrote:
>
> forgot to include that to create the new app, use the admin function: 
>
> New simple application
>
> that's where I see that layout is missing header includers
>
> thanks
>
> Alex
>

I used the button to create mynewapp.   The file 
mynewapp/views/default/index.html indeed has the block to show title and 
subtitle. I click on "try view", and it shows the title (defaulted to 
appname).  I go back and edit default.py to add a subtitle, go to the view, 
and click on "try view"  voila, the subtitle shows up.

/dps

-- 
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/d/optout.


[web2py] Re: missing response.title and subtitle

2016-04-13 Thread Alex Glaros
forgot to include that to create the new app, use the admin function: 

New simple application

that's where I see that layout is missing header includers

thanks

Alex

-- 
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/d/optout.


[web2py] Re: Scheduler not finding module

2016-04-13 Thread peter
I do have more than one python, but I thought the python the scheduler was 
using was the one specified in the RUN statement above, and  
DAEMON=python2.6

As I showed, python2.6 has dropbox installed. How could a scheduler task 
use a different python? This is useful to know.
Thanks
Peter

-- 
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/d/optout.


[web2py] Re: missing response.title and subtitle

2016-04-13 Thread Alex Glaros
hi Dave

I know it's in the sample but didn't it used to automatically populate when 
creating any new function besides index.html?

Can you please try creating a new function besides index.html and see if 
the title/subtitle appear in view automatically (after adding them to the 
controller of the same name)?

thanks,

Alex

-- 
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/d/optout.


[web2py] Re: sequential requests

2016-04-13 Thread Jason Solack
No database. I took out all the model files. I am just iterating through some 
lists then sleeping for 5 seconds.

-- 
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/d/optout.


[web2py] Re: web2py 2.14.4 is OUT

2016-04-13 Thread Dave S


On Wednesday, April 13, 2016 at 1:41:12 PM UTC-7, Alex Glaros wrote:
>
> was this below left out of layout.html?  I just see the word "include" 
> there but nothing to include
>
> {{block header}}
> 
>   
> {{if response.title:}}
> {{=response.title}}
>   {{=response.subtitle or ''}}
> {{pass}}
>   
> 
> {{end}}
>
> thanks,
>
> Alex Glaros
>



Layout.html didn't change.  This comes from 
welcome/views/default/index.html.

/dps
 

-- 
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/d/optout.


[web2py] Re: sequential requests

2016-04-13 Thread Dave S


On Wednesday, April 13, 2016 at 1:35:10 PM UTC-7, Jason Solack wrote:
>
> Hello all, 
>
> I have set up a simple site on aws to test concurrent requests and it 
> appears i'm getting requests answered sequentially...
>
> https://52.207.216.107/ServerTest/default/index
>
> I essentially ran the ubuntu setup script and tested it... i have upped 
> the processes and threads in the default.conf of apache, but it still seems 
> to process each request one at a time. 
>
> I'm hoping there is something simple i am doing wrong!
>
> Thanks for the help!
>
> Jason
>


What database engine are you using?  if sqlite3, it uses file locking that 
can force sequential behavior.

If you're using a production-class database, this is less likely to be the 
explanation.

/dps
 

-- 
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/d/optout.


[web2py] Re: missing response.title and subtitle

2016-04-13 Thread Dave S


On Wednesday, April 13, 2016 at 1:07:58 PM UTC-7, Alex Glaros wrote:
>
> Do we have to manually add this to each page now?
>
> {{block header}}
> 
>   
> {{if response.title:}}
> {{=response.title}}
>   {{=response.subtitle or ''}}
> {{pass}}
>   
> 
> {{end}}
>
> Is not included in layout.html
>

It's in the sample default/index.html  in the welcome app.

/dps

-- 
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/d/optout.


Re: [web2py] Re: Slow TTFB debugging with Wing IDE

2016-04-13 Thread Max Slimmer
I'm doing that with sessions.
I'm pretty sure this is something to do with the IDE. I'll keep
investigating.

On Fri, Apr 8, 2016 at 1:27 AM, Niphlod  wrote:

> just call session.forget(response). You can read from the session as you
> like.
> session.forget() isn't going to add concurrency, it just not saves the
> session even in the event it got modifiedbut it still locks.
>
>
> On Thursday, April 7, 2016 at 9:12:13 PM UTC+2, MDSIII wrote:
>>
>> Thanks for the quick reply Niphlod. That was the first thing I tried but
>> it didn't help. Am I doing forget() correctly if I read a session attribute
>> and then call forget but never write to the session (until later of course)?
>>
>> Something I forgot to mention, some, but not all, the controller
>> functions access the DB (sqlite) but just read.
>>
>> On Thursday, April 7, 2016 at 12:04:41 PM UTC-7, Niphlod wrote:
>>>
>>> IMHO it's just sessions being locked to prevent concurrent
>>> modifications.
>>>
>>> if your ajax requests aren't using the session, put a
>>>
>>> session.forget(response)
>>>
>>> at the top of your function.
>>>
>>> http://web2py.com/books/default/chapter/29/04/the-core#session
>>>
>>> On Thursday, April 7, 2016 at 8:46:16 PM UTC+2, MDSIII wrote:

 Running web2py from the Wing IDE, so using the built-in rocket server,
 I see long Waiting times in Chrome Dev Tools for my ajax requests. I'm
 getting times in excess of 6 or 8 seconds.
 This is a single page application that fires off a bunch (7 or 8) ajax
 requests after the initial page load. I'm not sure how to confirm it but it
 seems as though the server is handling these requests serially.
 When I make a request to one of these long wait controller functions
 singly (either non-xhr or with xhr) it returns pretty quick (< 1 sec.).
 If I start web2py from console I don't see these long wait times.

 I'm pretty sure this is due to how wing manages worker threads but I'm
 hoping someone here also uses Wing for development and knows why this
 happens and a "fix". I don't remember it always being like this on previous
 versions.

 Using wing 5.1.10
 and web2py 2.13.4

 Thanks,

>>> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/Hf_HtBX9r6M/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
--Max III

-- 
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/d/optout.


[web2py] Re: web2py 2.14.4 is OUT

2016-04-13 Thread Alex Glaros
was this below left out of layout.html?  I just see the word "include" 
there but nothing to include

{{block header}}

  
{{if response.title:}}
{{=response.title}}
  {{=response.subtitle or ''}}
{{pass}}
  

{{end}}

thanks,

Alex Glaros

-- 
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/d/optout.


[web2py] sequential requests

2016-04-13 Thread Jason Solack
Hello all, 

I have set up a simple site on aws to test concurrent requests and it 
appears i'm getting requests answered sequentially...

https://52.207.216.107/ServerTest/default/index

I essentially ran the ubuntu setup script and tested it... i have upped the 
processes and threads in the default.conf of apache, but it still seems to 
process each request one at a time. 

I'm hoping there is something simple i am doing wrong!

Thanks for the help!

Jason

-- 
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/d/optout.


[web2py] Re: missing response.title and subtitle

2016-04-13 Thread Alex Glaros
Do have to manually add this to each page now?

{{block header}}

  
{{if response.title:}}
{{=response.title}}
  {{=response.subtitle or ''}}
{{pass}}
  

{{end}}

Is not included in layout.html

-- 
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/d/optout.


[web2py] Re: web2py 2.14.4 is OUT

2016-04-13 Thread Raul Monares
I just did some tests. It still saves empty strings as null when using 
SQLFORM or CRUD and the string field has default=''. But when using 
db.table.insert the empty string is stored.

On Tuesday, April 12, 2016 at 3:29:26 PM UTC-6, Massimo Di Pierro wrote:
>
> web2py 2.14.4 is out.
>
> It fixes some a problem with CAS and some style issues with examples.
> It also includes (and passes) a lot of new tests. 
>
> Thanks to Richard Vezina, Simone and Leonel for doing most of the work in 
> this release.
>
> Massimo
>

-- 
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/d/optout.


[web2py] Re: missing response.title and subtitle

2016-04-13 Thread Alex Glaros
forgot to state:

response.title works in index file for me too

please try again with a new function

thanks Dave

Alex

-- 
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/d/optout.


[web2py] Re: missing response.title and subtitle

2016-04-13 Thread Dave S


On Wednesday, April 13, 2016 at 12:35:21 PM UTC-7, Alex Glaros wrote:
>
> Can someone please help me? This is a huge favor
>
>
>- download the very latest Windows binary version from web2py.com
>- create the simplest possible app with simplest possible view
>- in controller for that view please add only this basic stuff
>
> response.title = T('Bye')
> response.subtitle = T('See you later!')
>
>- Browse to the view.  Do you see the title and subtitle?
>
>
> thanks!
>
> Alex
>

I took a shortcut, and set them in my existing default/index controller. 
 They show up for me, replacing the default ones ("appname" and "", 
respectively).

The key parts of default/index.html are



4 

 
{{block header}}
5 

 

6 

 
  
7 

 
{{if response.title:}}
8 

 
{{=response.title}}
9 

 
  {{=response.subtitle or ''}}
10 

 
{{pass}}
11 

 
  
12 

 

13 

 
{{end}}
14 

 

 
HTH

Dave
/dps

-- 
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/d/optout.


[web2py] Re: Empty strings stored as null in database

2016-04-13 Thread David Manns
This problem is still in 2.14.4. This use case suggests the problem is 
within form handling, nothing to do with database or adapter.

David Manns

On Monday, April 11, 2016 at 10:06:41 AM UTC-4, David Manns wrote:
>
> There is a similar problem with SQLFORM.factory. E.g:
>
> searchform=SQLFORM.factory(
> Field('name', 'string', default='', comment='(start of) last 
> name'),
> Field('status', 'string', requires=IS_EMPTY_OR(IS_IN_SET(['Full', 
> 'Student', 'Comp', 'Inactive']))),
> Field('paid_year', 'integer', requires=IS_EMPTY_OR(IS_PAID_YEAR()),
> comment="'' or '0', paid date 9/30/'' 
> or no paid date"),
> ...)
> 
> if searchform.accepts(request.vars, session):
> session.membersearch=searchform.vars
> 
>
> In searchform.vars the default empty strings are represented as None 
> rather than as empty strings.
>
> On Thursday, March 31, 2016 at 10:39:23 PM UTC-4, Raul Monares wrote:
>>
>> Hello
>> I just updated to version 2.14.3 and noticed that empty strings are being 
>> stored as null in database field. This didn't happened in 2.13.4.
>>
>> Is this the intended behavior ?
>>
>

-- 
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/d/optout.


[web2py] Re: missing response.title and subtitle

2016-04-13 Thread Alex Glaros
Can someone please help me? This is a huge favor


   - download the very latest Windows binary version from web2py.com
   - create the simplest possible app with simplest possible view
   - in controller for that view please add only this basic stuff
   
response.title = T('Bye')
response.subtitle = T('See you later!')

   - Browse to the view.  Do you see the title and subtitle?
   

thanks!

Alex

-- 
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/d/optout.


[web2py] Re: web2py 2.14.4 is OUT

2016-04-13 Thread Dave S
On Tuesday, April 12, 2016 at 2:29:26 PM UTC-7, Massimo Di Pierro wrote:
>
> web2py 2.14.4 is out.
>
> It fixes some a problem with CAS and some style issues with examples.
> It also includes (and passes) a lot of new tests. 
>
> Thanks to Richard Vezina, Simone and Leonel for doing most of the work in 
> this release.
>
> Massimo
>


Looking good for the apps on my old Fedora system, (local browser FF 
 45.0.1)

My fabfile indicates stupid.css is the only static file I needed to update.

/dps



-- 
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/d/optout.


[web2py] Re: How to integrate SendGrid in Web2py ?

2016-04-13 Thread Krishna Bavandlapally
Thank you Leonel Câmara.

It worked.

mail.settings.server = 'smtp.sendgrid.net:587'
mail.settings.sender = xxx...@mail.com
mail.settings.login = 'sendgrid_username:sendgrid_password'
mail.settings.tls = True



On Wednesday, 13 April 2016 14:29:16 UTC+5:30, Krishna Bavandlapally wrote:
>
> How to integrate (default mailing) SendGrid in Web2py ?
>

-- 
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/d/optout.


[web2py] Re: What are the platforms for free web hosting of web2py apps?

2016-04-13 Thread Mirek Zvolský
I have web2py at forpsi.
I use virtual machine Debian there (about 1.20 EUR / month).
I have installed nginx (apt install nginx) and then web2py using scripts/
setup-web2py-nginx-uwsgi-ubuntu.sh
But seems for systemd some files are missing. You can read more in ubuntu 
web2py 

 
thread.
And you can take the script from my repo 
,
 
where these files are created. Hope it will run well.
My comments in czech language are here 
, google 
translator could help. Include https for free with letsencrypt.






Dne středa 13. dubna 2016 6:58:35 UTC+2 Stephen Duisberg napsal(a):
>
>
>
> On Monday, March 14, 2016 at 5:58:13 PM UTC+5:30, Mirek Zvolský wrote:
>>
>> allwaysdata.com, but has only 10M place (about 6M after you install 
>> web2py-min), good ssh, cron, no problem to install everything.
>> forpsi.com paid, but only 2$/month for full VM
>>
>> but forpsi isnt for web2py,right?
>>
>>> Which one's the best to go for?
>>>
>>

-- 
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/d/optout.


[web2py] What's my error here such that image resize gives error?

2016-04-13 Thread Stephen Duisberg
def changedp():
dpform=SQLFORM.factory(Field('img','upload', 
uploadfolder=os.path.join(request.folder,'uploads/')),table_name='info').process()
if dpform.accepts(request.vars,session,formname="dpformm"):
basewidth = 300
img = Image.open("{{=URL('uploads',dpform.vars.img)}}")
wpercent = (basewidth/float(img.size[0]))
hsize = int((float(img.size[1])*float(wpercent)))
img = img.resize((basewidth,hsize), PIL.Image.ANTIALIAS)
img.save("{{=URL('uploads',dpform.vars.img)}}")
   return locals()

{{extend 'layout.html'}}
{{=dpform}}


and the error says:
 [Errno 2] No such file or directory: 
"{{=URL('uploads',dpformm.vars.img)}}"

also is img.save("{{=URL('uploads',dpform.vars.img)}}")correct as 
syntax?
How should I correct these?

-- 
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/d/optout.


[web2py] Re: Creating form in the view

2016-04-13 Thread Anthony
On Wednesday, April 13, 2016 at 9:46:32 AM UTC-4, rajjmatt...@gmail.com 
wrote:
>
> Another work around would be to do it this way in the controller probably. 
> form=FORM('Your 
> name:', INPUT(_name='name'), INPUT(_type='submit')). 
>

That's no different from SQLFORM(db.mytable), but more verbose, and lacks 
validation as well as CSRF protection.

Anthony

-- 
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/d/optout.


[web2py] xmlrpclib use_datetime=True has no effect on web2py side

2016-04-13 Thread Hrobjartur Thorsteinsson
When passing datetime.datetime objects to service.xmlrpc  in web2py xmlrpc 
DateTime objects are not converted python datetime.datime,
even when explicitly setting up a connection with use_datetime = True.

  s = 
xmlrpclib.ServerProxy("http://localhost:8000/masterdb/device_history/call/xmlrpc";,
 
use_datetime=True)
  s.foo({mytime:datetime.datetime.now()})

The controller receives this as xmlrpclib  DateTime object, which is 
completely incompatible with DAL db interface and causes db errors.

I'm wondering if this is a bug with xmlrpclib  in python 2.7  or is there 
something in web2py that could be improved?

-- 
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/d/optout.


[web2py] Re: How to integrate SendGrid in Web2py ?

2016-04-13 Thread Ron Chatterjee
On that note. Leonel, how do we create inbox using web2py that looks 
similar to outlook? So, when someone write a blog post and other replies or 
for chat application to say, we can use that outlook looking interface to 
present the data. Can someone reply to the mail we send with 
u...@myweb2pyapp.com?



On Wednesday, April 13, 2016 at 6:32:17 AM UTC-4, Leonel Câmara wrote:
>
> If you're asking this, I'm just going to tell you the most obvious way. 
> Just use their SMTP server. I've never used sendgrid with web2py but the 
> config would be something like this:
>
> mail.settings.server = 'smtp.sendgrid.net:587'
> mail.settings.login = 'sendgrid_username:sengrid_password'
> mail.settings.tls = True
>

-- 
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/d/optout.


[web2py] Excel like filter in grid

2016-04-13 Thread Gael Princivalle
Hello.

I would like to make a grid with some drop down menus for filtering results.

Is there already something that exist ?

Thanks.

-- 
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/d/optout.


[web2py] Deploying Web2py on AWS Mobile Hub

2016-04-13 Thread Carl Hunter Roach
With AWS Mobile Hub supporting Python and deployment zip files for any 
libraries has anyone taken this route and have AWS Lambda backed by Web2py?

-- 
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/d/optout.


[web2py] Re: Error: Permission denied to access property "document"

2016-04-13 Thread Niphlod
any "X-Frame-Options" header returned ? 
google around, there are tons of ready-baked solutions.

On Tuesday, April 12, 2016 at 11:28:06 PM UTC+2, Nalab wrote:
>
> Hi
> When trying to run pop-up window,I'm getting this error "Error: Permission 
> denied to access property "document"",, Anyone with experience how to get 
> around this error? regards
>

-- 
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/d/optout.


[web2py] Re: Scheduler not finding module

2016-04-13 Thread Niphlod
how many python(s) have you available ? it's possible that the inner 
process gets started with the default interpreter . 
BTW: those kind of issues are the reason behind virtual environments...

On Wednesday, April 13, 2016 at 2:29:18 PM UTC+2, peter wrote:
>
> I have an issue with processes run by the scheduler are not seeing a 
> module.
>
> If I Do
> python2.6
> >>>import dropbox
>
> it imports fine.
>
> The conf file for the web2py scheduler contains
>
> DAEMON=python2.6
> PARAMETERS="/opt/web-apps/web2py/web2py.py -K new_spin2"
> LOGFILE=/var/log/web2py-scheduler.log
>
> start() {
> echo -n "starting up $DAEMON"
> RUN=`$DAEMON $PARAMETERS > $LOGFILE 2>&1`
> if [ "$?" -eq 0 ]; then
> echo " Done."
> else
> echo " FAILED."
> fi
> }
>
>
> So it is also using python2.6
>
> However I get  
> ImportError: No module named dropbox
>
> when a task is run by the scheduler. If I run the same web2py function 
> directly from a url, then it works fine.
>
> So how come the function when run by the scheduler does not see the 
> dropbox module
>
> Thanks
> Peter
>
>  
>

-- 
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/d/optout.


[web2py] Re: Creating form in the view

2016-04-13 Thread rajjmatthur
Another work around would be to do it this way in the controller probably. 
form=FORM('Your 
name:', INPUT(_name='name'), INPUT(_type='submit')). 

But if I define the form in the book example as shown below, how do I pass 
form.vars back into that controller? Lets say I don't have a database for 
this form. It just simple search form. I will define the form in the view, 
get the associated variables (form.vars) and insert them in the table 
inside the action (controller).   


{{=form.custom.begin}}Name: {{=form.custom.widget.name}}File: 
{{=form.custom.widget.source}}{{=form.custom.submit}}{{=form.custom.end}}

On Wednesday, April 13, 2016 at 8:10:49 AM UTC-4, Anthony wrote:
>
> See 
> http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-in-HTML.
>  
> Note, by setting session=None, there is no _formkey in the form and 
> therefore no CSRF protection. You can remove the session=None, but in that 
> case you will have to include the _formkey hidden field in the form as 
> well. The easiest way to do that is to end the form with:
>
> {{=form.custom.end}}
>
> Note, the above includes the _formkey and the _formname hidden fields (so 
> no need to explicitly include the _formname field) as well as the closing 
>  tag.
>
> You might also want to have a look at 
> http://web2py.com/books/default/chapter/29/07/forms-and-validators#Custom-forms
> .
>
> Anthony
>
> On Wednesday, April 13, 2016 at 6:30:01 AM UTC-4, rajjm...@gmail.com 
>  wrote:
>>
>> Newby question.
>>
>> def mydef():
>>
>> form = SQLFORM(db.mytable)
>> if form.process.accept():
>>  conditions here
>> return locals()
>>
>> view:
>> {{=form}}
>>
>> What if form is defined in the view first.
>>
>> How to invoke the controller. if in view
>>
>> 
>> first name: 
>> 
>> last name: 
>> 
>> 
>>
>> How to process this form and accept it in the controller. like if 
>> form.process.accept():
>>
>

-- 
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/d/optout.


Re: [web2py] Re: Odd error

2016-04-13 Thread Richard Vézina
Did you upgrade? If so, you most probably did it with root privileges... So
the permission should probably come from there, been change at the upgrade
time...

On Wed, Apr 13, 2016 at 9:06 AM, Leonel Câmara 
wrote:

> Was appadmin being accessed? It uses admin for authentication by default.
>
> --
> 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/d/optout.
>

-- 
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/d/optout.


[web2py] Re: Odd error

2016-04-13 Thread Leonel Câmara
Was appadmin being accessed? It uses admin for authentication by default.

-- 
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/d/optout.


[web2py] Re: Odd error

2016-04-13 Thread Jason Solack
So when these errors were occurring i saw about 20 error tickets per minute 
being generated in the admin app.  there was no traffic toward the admin 
app at the time, any idea why that would happen?

On Wednesday, April 13, 2016 at 3:27:21 AM UTC-4, Niphlod wrote:
>
> there's none. admin is an application by itself.
>
> On Tuesday, April 12, 2016 at 9:54:08 PM UTC+2, Jason Solack wrote:
>>
>> It's running in linux with apache/WSGI, i'm not exactly sure what you are 
>> asking, how are we launching web2py?
>>
>> Just to be clear, we're looking into how the permissions where changed, 
>> what i'm more curious about is what the relationship between our admin app 
>> and the other apps.  Why would an error on our admin app cause instability 
>> on all other apps.
>>
>> On Tuesday, April 12, 2016 at 3:33:51 PM UTC-4, Niphlod wrote:
>>>
>>> every process that is running the web2py app should have permissions to 
>>> read and write into the web2py folder. 
>>> if a sessions folder isn't found when the first request hits the app, 
>>> web2py creates it, but it does so under the current security environment...
>>> Whoever is changing the permissions is not web2py itself: it doesn't 
>>> make anything about changing users/permissions
>>>
>>> how are you running web2py ? 
>>>
>>> On Tuesday, April 12, 2016 at 9:07:01 PM UTC+2, Jason Solack wrote:

 Hello everyone!

 So we have experienced an odd error recently and i'm hoping someone 
 could help shed light on what happened.  We have several applications 
 running on centOS / apache and yesterday we began to experience the apps 
 going down periodically and then coming back up.  Another odd thing we 
 noticed was the admin page was throwing an error.  After looking around a 
 bit we found that the sessions folder in the admin app was owned by root. 
  The errors admin was throwing related to permissions to write to the 
 sessions folder.  After fixing those permissions things have become stable 
 again.  I am wondering if anyone could explain what the relationship 
 between our admin / sessions and all the other apps running on our site.

 Hopefully that makes sense and thank you for you help!  

 Jason

>>>

-- 
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/d/optout.


[web2py] Scheduler not finding module

2016-04-13 Thread peter
I have an issue with processes run by the scheduler are not seeing a module.

If I Do
python2.6
>>>import dropbox

it imports fine.

The conf file for the web2py scheduler contains

DAEMON=python2.6
PARAMETERS="/opt/web-apps/web2py/web2py.py -K new_spin2"
LOGFILE=/var/log/web2py-scheduler.log

start() {
echo -n "starting up $DAEMON"
RUN=`$DAEMON $PARAMETERS > $LOGFILE 2>&1`
if [ "$?" -eq 0 ]; then
echo " Done."
else
echo " FAILED."
fi
}


So it is also using python2.6

However I get  
ImportError: No module named dropbox

when a task is run by the scheduler. If I run the same web2py function 
directly from a url, then it works fine.

So how come the function when run by the scheduler does not see the dropbox 
module

Thanks
Peter

 

-- 
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/d/optout.


[web2py] Re: missing response.title and subtitle

2016-04-13 Thread Anthony
I assume it's a CSS issue, but don't know what the original or new CSS 
looks like, so difficult to say. Maybe use the browser tools to inspect the 
CSS properties in both versions and figure out what is different.

Anthony

On Wednesday, April 13, 2016 at 2:14:54 AM UTC-4, Alex Glaros wrote:
>
> ooops, meant layout.html, not menu.py
>
> anyway, this looks much better (it's in layout.html): I added the 
> highlighted text.
>
> 
> {{block header}}
> 
> {{=response.title or request.application}} 
> {{=response.subtitle or ''}}
> 
> {{end}}
> 
>
> Is there a way to deduce what is missing by seeing that this hack in 
> layout.html almost fixes the problem?
>
> thanks
>
> Alex
>

-- 
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/d/optout.


[web2py] Re: Creating form in the view

2016-04-13 Thread Anthony
See 
http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-in-HTML.
 
Note, by setting session=None, there is no _formkey in the form and 
therefore no CSRF protection. You can remove the session=None, but in that 
case you will have to include the _formkey hidden field in the form as 
well. The easiest way to do that is to end the form with:

{{=form.custom.end}}

Note, the above includes the _formkey and the _formname hidden fields (so 
no need to explicitly include the _formname field) as well as the closing 
 tag.

You might also want to have a look 
at 
http://web2py.com/books/default/chapter/29/07/forms-and-validators#Custom-forms.

Anthony

On Wednesday, April 13, 2016 at 6:30:01 AM UTC-4, rajjmatt...@gmail.com 
wrote:
>
> Newby question.
>
> def mydef():
>
> form = SQLFORM(db.mytable)
> if form.process.accept():
>  conditions here
> return locals()
>
> view:
> {{=form}}
>
> What if form is defined in the view first.
>
> How to invoke the controller. if in view
>
> 
> first name: 
> 
> last name: 
> 
> 
>
> How to process this form and accept it in the controller. like if 
> form.process.accept():
>

-- 
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/d/optout.


[web2py] Re: How to not let user input some particular values in the name field in this db?

2016-04-13 Thread Anthony
bad_names = ['list', 'of', 'bad', 'names']

db.define_table(...,
Field('name', requires=IS_MATCH(r'^(?!%s)' % '|'.join('%s$' % w for w 
in bad_names)),
...)

The above will produce a regular expression like:

r'^(?!list$|of$|bad$|names$)'

which will match anything except what is in the list.

Alternatively, you could make a custom 
validator: 
http://web2py.com/books/default/chapter/29/07/forms-and-validators#Custom-validators

Anthony

On Wednesday, April 13, 2016 at 6:20:12 AM UTC-4, Stephen Duisberg wrote:
>
> db.define_table('person',
> Field('name'),
> Field('pic','upload')
> )
>
> What should I do such that the name field won't accept names with some 
> words like 'the', 'rock' and all.
>

-- 
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/d/optout.


[web2py] Re: How do you change the color of the label of the sqlforms display in the view?

2016-04-13 Thread Leonel Câmara
Use CSS?

-- 
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/d/optout.


[web2py] Re: How to not let user input some particular values in the name field in this db?

2016-04-13 Thread Leonel Câmara
> You can also handle it at the client side, using JavaScript.

No no, you can do it but you still need to validate it server side. Never 
trust external input.

-- 
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/d/optout.


[web2py] How to not let user input some particular values in the name field in this db?

2016-04-13 Thread Nico de Groot
See the Web2py book at 
http://web2py.com/books/default/chapter/29/07/forms-and-validators We have 
validators for this purpose.
You can also handle it at the client side, using JavaScript.

Nico de Groot

-- 
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/d/optout.


[web2py] Re: Sending email w/ text & html

2016-04-13 Thread Leonel Câmara
It does send both the text and the HTML, the thing is that the HTML is 
placed in the email as a multipart/alternative to the text. 
multipart/alternative is used when each of the parts is an "alternative" 
version of the same information. Your email client then picks which one to 
show, since you're using an email client that can display HTML it chooses 
the HTML version. 

-- 
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/d/optout.


[web2py] Re: Sending email w/ text & html

2016-04-13 Thread Scott Hunter
I tried this, but to no effect: only the HTML portion appears in the 
message, as before.

- Scott

On Tuesday, April 12, 2016 at 11:12:30 PM UTC-4, H. Das wrote:
>
> Hi can you try:
>
> mail.send(to='y...@example.com', subject=subject, message=msg, 
> headers={'Content-Type' : 'text/html'})
>
> On Tuesday, April 12, 2016 at 8:28:56 PM UTC-4, Scott Hunter wrote:
>
>> According to the current book, I should be able to do this:
>>
>> mail.send('y...@example.com',
>>   'Message subject',
>>   ('Plain text body', 'html body'))
>>
>>
>> When I try:
>>
>> msg = ("Text only","HTML Only")
>> mail.send(to='y...@example.com', subject=subject, 
>> message=msg )
>>
>>
>> the text part does not appear in the received email, only the HTML part.
>>
>> Is this a bug, or am I mis-reading the documentation?
>>
>

-- 
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/d/optout.


[web2py] Re: How to integrate SendGrid in Web2py ?

2016-04-13 Thread Leonel Câmara
If you're asking this, I'm just going to tell you the most obvious way. 
Just use their SMTP server. I've never used sendgrid with web2py but the 
config would be something like this:

mail.settings.server = 'smtp.sendgrid.net:587'
mail.settings.login = 'sendgrid_username:sengrid_password'
mail.settings.tls = True

-- 
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/d/optout.


[web2py] Creating form in the view

2016-04-13 Thread rajjmatthur
Newby question.

def mydef():

form = SQLFORM(db.mytable)
if form.process.accept():
 conditions here
return locals()

view:
{{=form}}

What if form is defined in the view first.

How to invoke the controller. if in view


first name: 

last name: 



How to process this form and accept it in the controller. like if 
form.process.accept():

-- 
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/d/optout.


[web2py] How to not let user input some particular values in the name field in this db?

2016-04-13 Thread Stephen Duisberg
db.define_table('person',
Field('name'),
Field('pic','upload')
)

What should I do such that the name field won't accept names with some 
words like 'the', 'rock' and all.

-- 
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/d/optout.


[web2py] How to integrate SendGrid in Web2py ?

2016-04-13 Thread Krishna Bavandlapally
How to integrate (default mailing) SendGrid in Web2py ?

-- 
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/d/optout.


[web2py] Re: Odd error

2016-04-13 Thread Niphlod
there's none. admin is an application by itself.

On Tuesday, April 12, 2016 at 9:54:08 PM UTC+2, Jason Solack wrote:
>
> It's running in linux with apache/WSGI, i'm not exactly sure what you are 
> asking, how are we launching web2py?
>
> Just to be clear, we're looking into how the permissions where changed, 
> what i'm more curious about is what the relationship between our admin app 
> and the other apps.  Why would an error on our admin app cause instability 
> on all other apps.
>
> On Tuesday, April 12, 2016 at 3:33:51 PM UTC-4, Niphlod wrote:
>>
>> every process that is running the web2py app should have permissions to 
>> read and write into the web2py folder. 
>> if a sessions folder isn't found when the first request hits the app, 
>> web2py creates it, but it does so under the current security environment...
>> Whoever is changing the permissions is not web2py itself: it doesn't make 
>> anything about changing users/permissions
>>
>> how are you running web2py ? 
>>
>> On Tuesday, April 12, 2016 at 9:07:01 PM UTC+2, Jason Solack wrote:
>>>
>>> Hello everyone!
>>>
>>> So we have experienced an odd error recently and i'm hoping someone 
>>> could help shed light on what happened.  We have several applications 
>>> running on centOS / apache and yesterday we began to experience the apps 
>>> going down periodically and then coming back up.  Another odd thing we 
>>> noticed was the admin page was throwing an error.  After looking around a 
>>> bit we found that the sessions folder in the admin app was owned by root. 
>>>  The errors admin was throwing related to permissions to write to the 
>>> sessions folder.  After fixing those permissions things have become stable 
>>> again.  I am wondering if anyone could explain what the relationship 
>>> between our admin / sessions and all the other apps running on our site.
>>>
>>> Hopefully that makes sense and thank you for you help!  
>>>
>>> Jason
>>>
>>

-- 
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/d/optout.


[web2py] How do you change the color of the label of the sqlforms display in the view?

2016-04-13 Thread Emmanuel Dsouza
exact syntax?

-- 
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/d/optout.