[web2py] nginx web2py http to https rewrite

2013-08-29 Thread lbd
Hi all, I recently setup a site using the nginx web2py ubuntu script. What 
I want to do is redirect all http traffic to https. In order to do this I 
tried modifying the /etc/nginx/sites-available/web2py script with a simple 
rewrite rule:

server {
listen  80;
server_name $hostname;
###to enable correct use of response.static_version
#location ~* /(\w+)/static(?:/_[\d]+\.[\d]+\.[\d]+)?/(.*)$ {
#alias /home/www-data/web2py/applications/$1/static/$2;
#expires max;
#}
###

## redirect http to https ##
rewrite^ https://$server_name$request_uri? permanent;


Ironically if I type in my domain name using https://www.example.com or 
https://example.com it works perfectly. However when using http://.
I cannot get to the site?

Please could someone advise me as to what I am missing? Is there somewhere 
else in the nginx conf that i need to configure this, or in web2py itself?


-- 

--- 
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.


[web2py] Many forms in page with CRUD. Just want to check my approach is reasonable.

2013-08-29 Thread hiro
I have some tables that I want to be easily readable and editable. We 
groups with information, with subgroups that should all be easy edit and 
overview.

We have came up with a design that works but I now need to figure out how 
to be able to show edit forms for each row in the tables.

My first thought was to load each form using AJAX when needed, but I was 
unable to make the submit-button work.

I now have this idea:

In the view:
{{for group in groups:}}
{{=group.name}} - 
edit
{{pass}}

{{#In another part of page:}}



In the controller:
def crud_update():
from gluon.tools import Crud
crud = Crud(hb)
crud.settings.controller = 'test'
return XML(crud())

The problem is that after submit the original page is not updated with the 
new information, need to figure that one out...


So, what is the "proper" way to do this? Should it be an iframe, an ajax 
call or should I load all forms from the very beginning?


-- 

--- 
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.


[web2py] Re: nginx web2py http to https rewrite

2013-08-29 Thread Niphlod
if you want the server not to work on http but only in https, then you 
should have only one directive in the server block listeing to the 80 port:
server {
   listen 80;
   return 301 https://$host$request_uri;
}

On Thursday, August 29, 2013 10:15:43 AM UTC+2, lbd wrote:
>
> Hi all, I recently setup a site using the nginx web2py ubuntu script. What 
> I want to do is redirect all http traffic to https. In order to do this I 
> tried modifying the /etc/nginx/sites-available/web2py script with a simple 
> rewrite rule:
>
> server {
> listen  80;
> server_name $hostname;
> ###to enable correct use of response.static_version
> #location ~* /(\w+)/static(?:/_[\d]+\.[\d]+\.[\d]+)?/(.*)$ {
> #alias /home/www-data/web2py/applications/$1/static/$2;
> #expires max;
> #}
> ###
>
> ## redirect http to https ##
> rewrite^ https://$server_name$request_uri? permanent;
>
>
> Ironically if I type in my domain name using https://www.example.com or 
> https://example.com it works perfectly. However when using http://.
> I cannot get to the site?
>
> Please could someone advise me as to what I am missing? Is there somewhere 
> else in the nginx conf that i need to configure this, or in web2py itself?
>
>
>

-- 

--- 
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.


[web2py] Re: nginx web2py http to https rewrite

2013-08-29 Thread lbd
Thank you Niphlod, I would like it to listen on 80, but rewrite to https 
for all. I take it this is to be configured in 
the  /etc/nginx/sites-available/web2py file?

I will give it a bash now.

Much appreciated.

On Thursday, 29 August 2013 12:36:35 UTC+2, Niphlod wrote:
>
> if you want the server not to work on http but only in https, then you 
> should have only one directive in the server block listeing to the 80 port:
> server {
>listen 80;
>return 301 https://$host$request_uri;
> }
>
> On Thursday, August 29, 2013 10:15:43 AM UTC+2, lbd wrote:
>>
>> Hi all, I recently setup a site using the nginx web2py ubuntu script. 
>> What I want to do is redirect all http traffic to https. In order to do 
>> this I tried modifying the /etc/nginx/sites-available/web2py script with a 
>> simple rewrite rule:
>>
>> server {
>> listen  80;
>> server_name $hostname;
>> ###to enable correct use of response.static_version
>> #location ~* /(\w+)/static(?:/_[\d]+\.[\d]+\.[\d]+)?/(.*)$ {
>> #alias /home/www-data/web2py/applications/$1/static/$2;
>> #expires max;
>> #}
>> ###
>>
>> ## redirect http to https ##
>> rewrite^ https://$server_name$request_uri? permanent;
>>
>>
>> Ironically if I type in my domain name using https://www.example.com or 
>> https://example.com it works perfectly. However when using http://.
>> I cannot get to the site?
>>
>> Please could someone advise me as to what I am missing? Is there 
>> somewhere else in the nginx conf that i need to configure this, or in 
>> web2py itself?
>>
>>
>>

-- 

--- 
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.


[web2py] Re: nginx web2py http to https rewrite

2013-08-29 Thread lbd
Awesome Niphlod, that works like a bomb. I really appreciate it.



On Thursday, 29 August 2013 12:36:35 UTC+2, Niphlod wrote:
>
> if you want the server not to work on http but only in https, then you 
> should have only one directive in the server block listeing to the 80 port:
> server {
>listen 80;
>return 301 https://$host$request_uri;
> }
>
> On Thursday, August 29, 2013 10:15:43 AM UTC+2, lbd wrote:
>>
>> Hi all, I recently setup a site using the nginx web2py ubuntu script. 
>> What I want to do is redirect all http traffic to https. In order to do 
>> this I tried modifying the /etc/nginx/sites-available/web2py script with a 
>> simple rewrite rule:
>>
>> server {
>> listen  80;
>> server_name $hostname;
>> ###to enable correct use of response.static_version
>> #location ~* /(\w+)/static(?:/_[\d]+\.[\d]+\.[\d]+)?/(.*)$ {
>> #alias /home/www-data/web2py/applications/$1/static/$2;
>> #expires max;
>> #}
>> ###
>>
>> ## redirect http to https ##
>> rewrite^ https://$server_name$request_uri? permanent;
>>
>>
>> Ironically if I type in my domain name using https://www.example.com or 
>> https://example.com it works perfectly. However when using http://.
>> I cannot get to the site?
>>
>> Please could someone advise me as to what I am missing? Is there 
>> somewhere else in the nginx conf that i need to configure this, or in 
>> web2py itself?
>>
>>
>>

-- 

--- 
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.


[web2py] Thread problems

2013-08-29 Thread Johann Spies
For weeks I saw 'Failed to setup thread-interuupt handler.  This is usually
not critical' but today after updating from the trunk  I got the following:

*"ERROR:web2py:Traceback (most recent call last):
  File "/home/js/web2py/gluon/main.py", line 467, in wsgibase
session._try_store_in_db(request, response)
  File "/home/js/web2py/gluon/globals.py", line 1010, in _try_store_in_db
self.save_session_id_cookie()
  File "/home/js/web2py/gluon/globals.py", line 927, in
save_session_id_cookie
request = current.request
AttributeError: 'thread._local' object has no attribute 'request'

ERROR:web2py:Traceback (most recent call last):
  File "/home/js/web2py/gluon/main.py", line 467, in wsgibase
session._try_store_in_db(request, response)
  File "/home/js/web2py/gluon/globals.py", line 1010, in _try_store_in_db
self.save_session_id_cookie()
  File "/home/js/web2py/gluon/globals.py", line 927, in
save_session_id_cookie
request = current.request
AttributeError: 'thread._local' object has no attribute 'request'

Failed to setup thread-interrupt handler. This is usually not critical
"*
Regards
Johann

-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

-- 

--- 
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.


Re: [web2py] Any way of removing the text from Grid buttons?

2013-08-29 Thread Javier Pepe
Is simple

SQLFORM.grid(query,showbuttontext=False)


On Wed, Aug 28, 2013 at 8:19 PM, greenpoise  wrote:

> is there a way to remove the text from grid buttons? I mean the stock ones
> (View, Edit, Delete)
>
> --
>
> ---
> 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.
>

-- 

--- 
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.


[web2py] Re: Starting web2py fails silently with Cygwin python

2013-08-29 Thread Razvan Teslaru
Update: I managed to trace execution in web2py.py until "import 
gluon.widget" -- execution doesn't continue in web2py.py after that line, 
but again, no error message.

On Thursday, August 29, 2013 12:00:20 AM UTC+2, Razvan Teslaru wrote:
>
> Trying to run web2py under cygwin. Python 2.7.5 installed, plus all 
> necessary dependencies. 
>
> Downloaded and unzipped web2py_src.zip; when running ./web2py, it hangs 
> for a few seconds and then exits, without any message. Initially I thought 
> it might attempt (and fail) to spawn the GUI to get a password, but 
> starting it with -a 'passwd' yields the same behavior. 
>
> Tried uninstalling the cygwin python and using the regular Windows python 
> under Cygwin -- now it works as expected, so it appears to be a Cygwin 
> Python + web2py specific issue, but I'm not sure how to proceed from here, 
> without any sort of error message.
>

-- 

--- 
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.


[web2py] Several controllers inserting and updating one row via forms

2013-08-29 Thread shapovalovdenis
Hi!

I have an issue with UPDATE form. I'm trying to implement something like 
enrollment form that has man field beyond standard name, email, etc. For 
the sake of usability I've decided to split it to two steps (i.e. 
controllers - pages): first asks user for name and email, and after user 
submits it, he/she gets redirected to the second controller with UPDATE 
form for the same record, inserted with previous form.

Btw, at first I thought of having a one page form and presenting it in 
parts with help of JS, but I've decided to go with back end, to have even 
partially submitted data in database. 

def firstform():
form = SQLFORM(db.person, fields = ['email','name'])
if form.process(session=None, formname='begin_form').accepted:
session.person_id = form.vars.id
session.flash = 'form accepted'
redirect(URL('endjoin'))
elif form.errors:
response.flash = 'form has errors'
else:
response.flash = 'please fill the form'
return dict()

# and
def secondform():
record = db.person(session.person_id) or redirect(URL('index'))
form = SQLFORM(db.person, record, fields = ['address','phone',
'many_more_fields'])
if form.process(session=None, formname='end_form').accepted:
response.flash = 'form accepted'
elif form.errors:
response.flash = 'form has errors' 
else:
response.flash = 'please fill the form'
return dict()

The problems is that second action 'firstform' makes insert, instead of 
update to the record inserted by first action 'secondform'. Though 'record' 
contains reference to last add row, which should be updated(completed). I'm 
not passing form to the view, I use custom html to present my forms, 
because I didn't find a way to make helpers specify input type='email', 
placeholder, size and other HTML5 form parts attributes.

-- 

--- 
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.


[web2py] Re: Why is the plugins list empty in the wizard?

2013-08-29 Thread Massimo Di Pierro
Can you show me an example?

On Wednesday, 28 August 2013 20:52:39 UTC-5, Alan Etkin wrote:
>
> The problem is that the plugin app has been deprecated and plugins are 
>> being moved to github and web2pyslices. It was a nice automatism we did not 
>> have enough manpower to keep the plugins updated. It was not very useful.
>>
>
> It is possible to feed the admin app with a query to a web2pyslices 
> packages api (i.e. with json) for searching plugins.
>

-- 

--- 
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.


[web2py] Re: Thread problems

2013-08-29 Thread Massimo Di Pierro
Should now be fixed.

On Thursday, 29 August 2013 07:01:37 UTC-5, Johann Spies wrote:
>
> For weeks I saw 'Failed to setup thread-interuupt handler.  This is 
> usually not critical' but today after updating from the trunk  I got the 
> following:
>
> *"ERROR:web2py:Traceback (most recent call last):
>   File "/home/js/web2py/gluon/main.py", line 467, in wsgibase
> session._try_store_in_db(request, response)
>   File "/home/js/web2py/gluon/globals.py", line 1010, in _try_store_in_db
> self.save_session_id_cookie()
>   File "/home/js/web2py/gluon/globals.py", line 927, in 
> save_session_id_cookie
> request = current.request
> AttributeError: 'thread._local' object has no attribute 'request'
>
> ERROR:web2py:Traceback (most recent call last):
>   File "/home/js/web2py/gluon/main.py", line 467, in wsgibase
> session._try_store_in_db(request, response)
>   File "/home/js/web2py/gluon/globals.py", line 1010, in _try_store_in_db
> self.save_session_id_cookie()
>   File "/home/js/web2py/gluon/globals.py", line 927, in 
> save_session_id_cookie
> request = current.request
> AttributeError: 'thread._local' object has no attribute 'request'
>
> Failed to setup thread-interrupt handler. This is usually not critical
> "*
> Regards
> Johann
>
> -- 
> Because experiencing your loyal love is better than life itself, 
> my lips will praise you.  (Psalm 63:3)
>  

-- 

--- 
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.


[web2py] Re: Starting web2py fails silently with Cygwin python

2013-08-29 Thread Massimo Di Pierro
I have experienced the same problem. Yet I do not have a windows/cygwin 
machine here to debug it. Can you help us and figure out exactly where in 
gluon/widget.py it gets stuck?

On Thursday, 29 August 2013 08:04:26 UTC-5, Razvan Teslaru wrote:
>
> Update: I managed to trace execution in web2py.py until "import 
> gluon.widget" -- execution doesn't continue in web2py.py after that line, 
> but again, no error message.
>
> On Thursday, August 29, 2013 12:00:20 AM UTC+2, Razvan Teslaru wrote:
>>
>> Trying to run web2py under cygwin. Python 2.7.5 installed, plus all 
>> necessary dependencies. 
>>
>> Downloaded and unzipped web2py_src.zip; when running ./web2py, it hangs 
>> for a few seconds and then exits, without any message. Initially I thought 
>> it might attempt (and fail) to spawn the GUI to get a password, but 
>> starting it with -a 'passwd' yields the same behavior. 
>>
>> Tried uninstalling the cygwin python and using the regular Windows python 
>> under Cygwin -- now it works as expected, so it appears to be a Cygwin 
>> Python + web2py specific issue, but I'm not sure how to proceed from here, 
>> without any sort of error message.
>>
>

-- 

--- 
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.


Re: [web2py] Several controllers inserting and updating one row via forms

2013-08-29 Thread Vinicius Assef
It would be nice if you show your view.

Probably you're missing a hidden field in second form with the record id.

On Thu, Aug 29, 2013 at 10:12 AM,   wrote:
> Hi!
>
> I have an issue with UPDATE form. I'm trying to implement something like
> enrollment form that has man field beyond standard name, email, etc. For the
> sake of usability I've decided to split it to two steps (i.e. controllers -
> pages): first asks user for name and email, and after user submits it,
> he/she gets redirected to the second controller with UPDATE form for the
> same record, inserted with previous form.
>
> Btw, at first I thought of having a one page form and presenting it in parts
> with help of JS, but I've decided to go with back end, to have even
> partially submitted data in database.
>
> def firstform():
> form = SQLFORM(db.person, fields = ['email','name'])
> if form.process(session=None, formname='begin_form').accepted:
> session.person_id = form.vars.id
> session.flash = 'form accepted'
> redirect(URL('endjoin'))
> elif form.errors:
> response.flash = 'form has errors'
> else:
> response.flash = 'please fill the form'
> return dict()
>
> # and
> def secondform():
> record = db.person(session.person_id) or redirect(URL('index'))
> form = SQLFORM(db.person, record, fields =
> ['address','phone','many_more_fields'])
> if form.process(session=None, formname='end_form').accepted:
> response.flash = 'form accepted'
> elif form.errors:
> response.flash = 'form has errors'
> else:
> response.flash = 'please fill the form'
> return dict()
>
> The problems is that second action 'firstform' makes insert, instead of
> update to the record inserted by first action 'secondform'. Though 'record'
> contains reference to last add row, which should be updated(completed). I'm
> not passing form to the view, I use custom html to present my forms, because
> I didn't find a way to make helpers specify input type='email', placeholder,
> size and other HTML5 form parts attributes.
>
> --
>
> ---
> 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.

-- 

--- 
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.


Re: [web2py] Simple BASE in routes.py gives me "invalid request"

2013-08-29 Thread Wei Wang
Jonathan,

I am embarrassed to report that is has been a user error -- my fault -- 
that I got two different versions of web2py running in the same instance of 
apache2. I didn't think to check my Apache configuration until I downloaded 
a stable version of the source, set it up and ran it manually, then the 
problem went away.

Your attention and support has been wonderful and much appreciated.

-- 

--- 
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.


[web2py] Using "external" database join with DAL

2013-08-29 Thread Gallien Labeyrie
Hi, 

I'm connecting to multiple MySQL databases through Web2Py. So far 
everything works fine! 
But for some dumb reasons, my databases do not follow usual good design 
practices. 
For example some of  the tables foreign keys refer to other database 
primary keys (which is surprisingly possible (!) because MySql seem to 
understand  a database more like a 'schema' )

So I'm wondering, Is it possible to use the DAL functions to query them and 
make JOIN even though they are referring another database?
or will I still have to stick to the old school *db.executesql()* ?

thanks for the help, 
Gallien

-- 

--- 
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.


[web2py] Re: new web2py.js changes the sequence of execution

2013-08-29 Thread Paolo Valleri
Just to understand better what is going on, try to comment line 257 in 
web2py.js 
or even better the whole success block.

Paolo

On Thursday, August 29, 2013 3:42:29 AM UTC+2, Anthony wrote:
>
> Looks like this 
> changewas
>  actually made in January in response to this 
> issue . 
> Technically, I suppose it does break backward compatibility because 
> previously web2py-component-command (i.e., the content of response.js) was 
> executed synchronously after the component content loaded, and now it is 
> run asynchronously. Actually, this was probably not a good move, because 
> you might need the JS to run after the component content has loaded, so we 
> might want to revert this change. The web2py-component-command and 
> web2py-component-flash headers were intended for use specifically with 
> components. If we want to enable such functionality more generally, perhaps 
> we should use alternative headers for that purpose. Please open an issue 
> about this and link back to this thread.
>
> Anthony
>
> On Wednesday, August 28, 2013 1:20:53 PM UTC-7, simon wrote:
>>
>> I have some very simple jquery scripts for creating dialog boxes. This 
>> was all working fine until the replacement of web2py.js in release 5113. 
>> However now it no longer works.
>>
>> The pre-5113 version had a web2py_ajax_page complete function that first 
>> filled my dialog box and then executed response.js in that order.
>>
>> The new version does these two things asynchronously.  Response.js is 
>> executed within event_handler and generally this happens before the 
>> ajax_page complete function.
>>
>> Is there some reason why this was changed or could it be changed back so 
>> things happen in the same sequence? This does break backward compatibility.
>>
>>
>>

-- 

--- 
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.


Re: [web2py] Simple BASE in routes.py gives me "invalid request"

2013-08-29 Thread Jonathan Lundell
On 29 Aug 2013, at 6:37 AM, Wei Wang  wrote:
> I am embarrassed to report that is has been a user error -- my fault -- that 
> I got two different versions of web2py running in the same instance of 
> apache2. I didn't think to check my Apache configuration until I downloaded a 
> stable version of the source, set it up and ran it manually, then the problem 
> went away.
> 
> Your attention and support has been wonderful and much appreciated.

I'm glad you tracked it down. Good trick, though!

-- 

--- 
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.


Re: [web2py] Simple BASE in routes.py gives me "invalid request"

2013-08-29 Thread Jonathan Lundell
On 29 Aug 2013, at 6:37 AM, Wei Wang  wrote:
> I am embarrassed to report that is has been a user error -- my fault -- that 
> I got two different versions of web2py running in the same instance of 
> apache2. I didn't think to check my Apache configuration until I downloaded a 
> stable version of the source, set it up and ran it manually, then the problem 
> went away.
> 
> Your attention and support has been wonderful and much appreciated.

One thing you still might do, though, as long as you're in testing mode: would 
you please try a request that is missing its view, but is otherwise OK? 

That's because, among your symptoms, you were getting an "invalid request" 
response with no details as to what was invalid. I'd like to track that down, 
because it's not a very helpful message, and there were some hints in your 
reports that it was associated with a missing view.

Thanks. And if it doesn't show up, just let me know and don't spend more time 
on it.

-- 

--- 
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.


[web2py] Scalability lessons from reddit

2013-08-29 Thread Michele Comitini
Not web2py specific, but most apply also to web2py.

http://highscalability.com/blog/2013/8/26/reddit-lessons-learned-from-mistakes-made-scaling-to-1-billi.html
mic

-- 

--- 
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.


[web2py] Re: Starting web2py fails silently with Cygwin python

2013-08-29 Thread Razvan Teslaru
This is really strange -- apparently, the execution never seems to reach 
gluon/widget.py at all. 

I edited widget.py and now the first line is a 'print "1"' statement, which 
never gets executed. Still no error messages. 

This seems to imply that the 'import gluon.widget' statement does not get 
executed at all.

On Thursday, August 29, 2013 3:29:53 PM UTC+2, Massimo Di Pierro wrote:
>
> I have experienced the same problem. Yet I do not have a windows/cygwin 
> machine here to debug it. Can you help us and figure out exactly where in 
> gluon/widget.py it gets stuck?
>
> On Thursday, 29 August 2013 08:04:26 UTC-5, Razvan Teslaru wrote:
>>
>> Update: I managed to trace execution in web2py.py until "import 
>> gluon.widget" -- execution doesn't continue in web2py.py after that line, 
>> but again, no error message.
>>
>> On Thursday, August 29, 2013 12:00:20 AM UTC+2, Razvan Teslaru wrote:
>>>
>>> Trying to run web2py under cygwin. Python 2.7.5 installed, plus all 
>>> necessary dependencies. 
>>>
>>> Downloaded and unzipped web2py_src.zip; when running ./web2py, it hangs 
>>> for a few seconds and then exits, without any message. Initially I thought 
>>> it might attempt (and fail) to spawn the GUI to get a password, but 
>>> starting it with -a 'passwd' yields the same behavior. 
>>>
>>> Tried uninstalling the cygwin python and using the regular Windows 
>>> python under Cygwin -- now it works as expected, so it appears to be a 
>>> Cygwin Python + web2py specific issue, but I'm not sure how to proceed from 
>>> here, without any sort of error message.
>>>
>>

-- 

--- 
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.


[web2py] Re: Starting web2py fails silently with Cygwin python

2013-08-29 Thread Razvan Teslaru
PS: I have both cygwin python and Windows python installed on the same 
machine, if relevant.

On Thursday, August 29, 2013 3:29:53 PM UTC+2, Massimo Di Pierro wrote:
>
> I have experienced the same problem. Yet I do not have a windows/cygwin 
> machine here to debug it. Can you help us and figure out exactly where in 
> gluon/widget.py it gets stuck?
>
> On Thursday, 29 August 2013 08:04:26 UTC-5, Razvan Teslaru wrote:
>>
>> Update: I managed to trace execution in web2py.py until "import 
>> gluon.widget" -- execution doesn't continue in web2py.py after that line, 
>> but again, no error message.
>>
>> On Thursday, August 29, 2013 12:00:20 AM UTC+2, Razvan Teslaru wrote:
>>>
>>> Trying to run web2py under cygwin. Python 2.7.5 installed, plus all 
>>> necessary dependencies. 
>>>
>>> Downloaded and unzipped web2py_src.zip; when running ./web2py, it hangs 
>>> for a few seconds and then exits, without any message. Initially I thought 
>>> it might attempt (and fail) to spawn the GUI to get a password, but 
>>> starting it with -a 'passwd' yields the same behavior. 
>>>
>>> Tried uninstalling the cygwin python and using the regular Windows 
>>> python under Cygwin -- now it works as expected, so it appears to be a 
>>> Cygwin Python + web2py specific issue, but I'm not sure how to proceed from 
>>> here, without any sort of error message.
>>>
>>

-- 

--- 
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.


[web2py] Re: Many forms in page with CRUD. Just want to check my approach is reasonable.

2013-08-29 Thread hiro
I have researched more and found out about the cid tag in the link helper. 
Works much better.

-- 

--- 
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.


[web2py] Re: CAS provider and registration

2013-08-29 Thread Larry Weinberg
I can get the register to redirect as I wanted by adding this to the CAS 
server application's default controller index function:

   if session.service_arg:
redirect(session.service_arg)

The only thing missing then is the register button.  It should be 
relatively trivial to add that in.

I would think it would be nice to have this all work by default or add to 
the book's section on CAS.





-- 

--- 
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.


[web2py] Re: WEB2PY iOS install APP

2013-08-29 Thread vince
i guess thats the best solution for now. the only downside is jailbreak 
required

anyone have experience with pyobjc? it is possible to just execute python 
code as daemon? 

On Monday, August 26, 2013 10:14:33 AM UTC+8, Massimo Di Pierro wrote:
>
> Did you see this: 
> http://www.web2pyslices.com/slice/show/1481/install-web2py-in-the-ipad
> Does it help?
>
>
> On Tuesday, 14 May 2013 17:51:06 UTC-5, Allan K wrote:
>>
>> Hi, 
>>
>> I need to work with an app for web2py, but I do not know if I can use 
>> web2py with iOS and install apps as I can with windows and macOS.
>>
>> Thanks.
>>
>

-- 

--- 
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.


[web2py] Smartgrid line color

2013-08-29 Thread António Ramos
Hello ,

i need a table (smartgrid) that highlights outdated records, for example
forcing the outdated record line inside the table to be filled with red
background and yellow text.


Can i do it with form.smartgrid?


Thank you
António

-- 

--- 
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.


[web2py] Re: new web2py.js changes the sequence of execution

2013-08-29 Thread simon
Niphlod - I have tried latest trunk and get same issue. 

Paolo - I tried that but it makes no difference. 

Anthony is correct. The problem is:
 that the  eval(decodeURIComponent(command)) happens in ajax.success then 
the t.html(html);



On Thursday, 29 August 2013 14:54:19 UTC+1, Paolo Valleri wrote:
>
> Just to understand better what is going on, try to comment line 257 in 
> web2py.js 
> or even better the whole success block.
>
> Paolo
>
> On Thursday, August 29, 2013 3:42:29 AM UTC+2, Anthony wrote:
>>
>> Looks like this 
>> changewas
>>  actually made in January in response to this 
>> issue . 
>> Technically, I suppose it does break backward compatibility because 
>> previously web2py-component-command (i.e., the content of response.js) was 
>> executed synchronously after the component content loaded, and now it is 
>> run asynchronously. Actually, this was probably not a good move, because 
>> you might need the JS to run after the component content has loaded, so we 
>> might want to revert this change. The web2py-component-command and 
>> web2py-component-flash headers were intended for use specifically with 
>> components. If we want to enable such functionality more generally, perhaps 
>> we should use alternative headers for that purpose. Please open an issue 
>> about this and link back to this thread.
>>
>> Anthony
>>
>> On Wednesday, August 28, 2013 1:20:53 PM UTC-7, simon wrote:
>>>
>>> I have some very simple jquery scripts for creating dialog boxes. This 
>>> was all working fine until the replacement of web2py.js in release 5113. 
>>> However now it no longer works.
>>>
>>> The pre-5113 version had a web2py_ajax_page complete function that first 
>>> filled my dialog box and then executed response.js in that order.
>>>
>>> The new version does these two things asynchronously.  Response.js is 
>>> executed within event_handler and generally this happens before the 
>>> ajax_page complete function.
>>>
>>> Is there some reason why this was changed or could it be changed back so 
>>> things happen in the same sequence? This does break backward compatibility.
>>>
>>>
>>>

-- 

--- 
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.


Re: [web2py] Any way of removing the text from Grid buttons?

2013-08-29 Thread greenpoise
geez, that is easy thanks



On Thursday, August 29, 2013 5:04:15 AM UTC-7, Javier Pepe wrote:
>
> Is simple
>
> SQLFORM.grid(query,showbuttontext=False)
>
>
> On Wed, Aug 28, 2013 at 8:19 PM, greenpoise 
> > wrote:
>
>> is there a way to remove the text from grid buttons? I mean the stock 
>> ones (View, Edit, Delete)
>>  
>> -- 
>>  
>> --- 
>> 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+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 

--- 
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.


Re: [web2py] Smartgrid line color

2013-08-29 Thread Roberto Perdomo
Hi António,

You can use a conditional represent to change the color of the date field
in your outdated record.

something like:

1) db.table.field.represent =lambda value, row: ""+value+"" if CONDITION else value

Or you can put the outdated field inside an specific div with an id and
iterate over the smartgrid table with Jquery to find the id, I Jquery find
the id, then change the row color:

2) db.table.field.represent =lambda value, row: ""+value+"" if CONDITION else value

I used something like the option 1, but I can not find the project at this
moment.




2013/8/29 António Ramos 

> Hello ,
>
> i need a table (smartgrid) that highlights outdated records, for example
> forcing the outdated record line inside the table to be filled with red
> background and yellow text.
>
>
> Can i do it with form.smartgrid?
>
>
> Thank you
> António
>
> --
>
> ---
> 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.
>

-- 

--- 
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.


[web2py] Help with deploying on nginx

2013-08-29 Thread Apple Mason
I keep getting 502 Bad Gateway, and I'm not sure why. I followed the Nginx 
deployment recipe on the website, with the following changes:

/etc/uwsgi/web2py.xml: Used /var/www-data/web2py/ instead of 
/home/www-data/web2py/

nginx conf: server_name is my server ip (I don't have a domain name) 
instead of $hostname. I also changed the location to /web2py instead of 
root.

Here is my nginx conf:

server {
listen 443 default_server ssl;
server_name xxx.xxx.xxx.xxx;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_ciphers ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:DHE-DSS-AES256-
SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA;
ssl_protocols SSLv3 TLSv1;
keepalive_timeout70;
location /web2py {
#uwsgi_pass  127.0.0.1:9001;
uwsgi_pass  unix:///tmp/web2py.socket;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
}
}



I omitted http since I only want to test over https for now.

Restarted both uwsgi and nginx in that order. uwsgi seems to find web2py 
okay in their logs:

announcing my loyalty to the Emperor...
*** vassal web2py.xml is now loyal ***


When I access "https:///web2py", I get the 502 error.

Nginx error.log says:

2013/08/29 18:10:08 [error] 9793#0: *4 upstream prematurely closed 
connection while reading response header from upstream, client: 
xxx.xxx.xxx.xxx, server: xxx.xxx.xxx.xxx, request: "GET /web2py HTTP/1.1", 
upstream: "uwsgi://unix:///tmp/web2py.socket:", host: "xxx.xxx.xxx.xxx.

I'm running ubuntu 13.04 server, if that's any use.


-- 

--- 
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.


[web2py] Re: new web2py.js changes the sequence of execution

2013-08-29 Thread simon


New version of web2py.js executes:
   eval(decodeURIComponent(command))in ajax.success
   t.html(html) in ajax.complete
However in the previous version these two commands executed in the reverse 
order.



If I change doc.ajaxSuccess to doc.ajaxComplete then it works.Not sure if 
this breaks something else though!

Have logged as an issue.


On Thursday, 29 August 2013 14:54:19 UTC+1, Paolo Valleri wrote:
>
> Just to understand better what is going on, try to comment line 257 in 
> web2py.js 
> or even better the whole success block.
>
> Paolo
>
> On Thursday, August 29, 2013 3:42:29 AM UTC+2, Anthony wrote:
>>
>> Looks like this 
>> changewas
>>  actually made in January in response to this 
>> issue . 
>> Technically, I suppose it does break backward compatibility because 
>> previously web2py-component-command (i.e., the content of response.js) was 
>> executed synchronously after the component content loaded, and now it is 
>> run asynchronously. Actually, this was probably not a good move, because 
>> you might need the JS to run after the component content has loaded, so we 
>> might want to revert this change. The web2py-component-command and 
>> web2py-component-flash headers were intended for use specifically with 
>> components. If we want to enable such functionality more generally, perhaps 
>> we should use alternative headers for that purpose. Please open an issue 
>> about this and link back to this thread.
>>
>> Anthony
>>
>> On Wednesday, August 28, 2013 1:20:53 PM UTC-7, simon wrote:
>>>
>>> I have some very simple jquery scripts for creating dialog boxes. This 
>>> was all working fine until the replacement of web2py.js in release 5113. 
>>> However now it no longer works.
>>>
>>> The pre-5113 version had a web2py_ajax_page complete function that first 
>>> filled my dialog box and then executed response.js in that order.
>>>
>>> The new version does these two things asynchronously.  Response.js is 
>>> executed within event_handler and generally this happens before the 
>>> ajax_page complete function.
>>>
>>> Is there some reason why this was changed or could it be changed back so 
>>> things happen in the same sequence? This does break backward compatibility.
>>>
>>>
>>>

-- 

--- 
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.


[web2py] Re: Using "external" database join with DAL

2013-08-29 Thread Massimo Di Pierro
No you cannot join tables from two different databases.

On Thursday, 29 August 2013 08:45:49 UTC-5, Gallien Labeyrie wrote:
>
> Hi, 
>
> I'm connecting to multiple MySQL databases through Web2Py. So far 
> everything works fine! 
> But for some dumb reasons, my databases do not follow usual good design 
> practices. 
> For example some of  the tables foreign keys refer to a different database 
> (which is surprisingly possible (!) because MySql seem to understand  a 
> database more like a 'schema' )
>
> So I'm wondering, Is it possible to use the DAL functions to query them 
> and make JOIN even though they are referring another database?
> or will I still have to stick to the old school *db.executesql()* ?
>
> I tried : 
> * db1(db1.tableA.some_fk_id==**db2.tableB.primary_key_id).**select()*
> which returns : 
> * *** AttributeError: 'DAL' object has no attribute 'tableB'*
> which is true but.. perhaps there is a way to do it :/
>
> thanks for the help, 
> Gallien
>
>

-- 

--- 
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.


[web2py] Re: Starting web2py fails silently with Cygwin python

2013-08-29 Thread Massimo Di Pierro
very weird. 

On Thursday, 29 August 2013 09:34:55 UTC-5, Razvan Teslaru wrote:
>
> This is really strange -- apparently, the execution never seems to reach 
> gluon/widget.py at all. 
>
> I edited widget.py and now the first line is a 'print "1"' statement, 
> which never gets executed. Still no error messages. 
>
> This seems to imply that the 'import gluon.widget' statement does not get 
> executed at all.
>
> On Thursday, August 29, 2013 3:29:53 PM UTC+2, Massimo Di Pierro wrote:
>>
>> I have experienced the same problem. Yet I do not have a windows/cygwin 
>> machine here to debug it. Can you help us and figure out exactly where in 
>> gluon/widget.py it gets stuck?
>>
>> On Thursday, 29 August 2013 08:04:26 UTC-5, Razvan Teslaru wrote:
>>>
>>> Update: I managed to trace execution in web2py.py until "import 
>>> gluon.widget" -- execution doesn't continue in web2py.py after that line, 
>>> but again, no error message.
>>>
>>> On Thursday, August 29, 2013 12:00:20 AM UTC+2, Razvan Teslaru wrote:

 Trying to run web2py under cygwin. Python 2.7.5 installed, plus all 
 necessary dependencies. 

 Downloaded and unzipped web2py_src.zip; when running ./web2py, it hangs 
 for a few seconds and then exits, without any message. Initially I thought 
 it might attempt (and fail) to spawn the GUI to get a password, but 
 starting it with -a 'passwd' yields the same behavior. 

 Tried uninstalling the cygwin python and using the regular Windows 
 python under Cygwin -- now it works as expected, so it appears to be a 
 Cygwin Python + web2py specific issue, but I'm not sure how to proceed 
 from 
 here, without any sort of error message.

>>>

-- 

--- 
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.


[web2py] Re: new web2py.js changes the sequence of execution

2013-08-29 Thread Anthony
We have a somewhat different fix -- should be pushed to trunk shortly. 
Please test it once it's there. Thanks.

Anthony

On Thursday, August 29, 2013 11:46:26 AM UTC-7, simon wrote:
>
> New version of web2py.js executes:
>eval(decodeURIComponent(command))in ajax.success
>t.html(html) in ajax.complete
> However in the previous version these two commands executed in the reverse 
> order.
>
>
>
> If I change doc.ajaxSuccess to doc.ajaxComplete then it works.Not sure if 
> this breaks something else though!
>
> Have logged as an issue.
>
>
> On Thursday, 29 August 2013 14:54:19 UTC+1, Paolo Valleri wrote:
>>
>> Just to understand better what is going on, try to comment line 257 in 
>> web2py.js 
>> or even better the whole success block.
>>
>> Paolo
>>
>> On Thursday, August 29, 2013 3:42:29 AM UTC+2, Anthony wrote:
>>>
>>> Looks like this 
>>> changewas
>>>  actually made in January in response to this 
>>> issue . 
>>> Technically, I suppose it does break backward compatibility because 
>>> previously web2py-component-command (i.e., the content of response.js) was 
>>> executed synchronously after the component content loaded, and now it is 
>>> run asynchronously. Actually, this was probably not a good move, because 
>>> you might need the JS to run after the component content has loaded, so we 
>>> might want to revert this change. The web2py-component-command and 
>>> web2py-component-flash headers were intended for use specifically with 
>>> components. If we want to enable such functionality more generally, perhaps 
>>> we should use alternative headers for that purpose. Please open an issue 
>>> about this and link back to this thread.
>>>
>>> Anthony
>>>
>>> On Wednesday, August 28, 2013 1:20:53 PM UTC-7, simon wrote:

 I have some very simple jquery scripts for creating dialog boxes. This 
 was all working fine until the replacement of web2py.js in release 5113. 
 However now it no longer works.

 The pre-5113 version had a web2py_ajax_page complete function that 
 first filled my dialog box and then executed response.js in that order.

 The new version does these two things asynchronously.  Response.js is 
 executed within event_handler and generally this happens before the 
 ajax_page complete function.

 Is there some reason why this was changed or could it be changed back 
 so things happen in the same sequence? This does break backward 
 compatibility.




-- 

--- 
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.


[web2py] Re: Starting web2py fails silently with Cygwin python

2013-08-29 Thread Niphlod
isn't it related to tk and cygwin being a little bit stubborn ?
see 
http://stackoverflow.com/questions/9393462/cannot-launch-git-gui-using-cygwin-on-windows

On Thursday, August 29, 2013 4:52:47 PM UTC+2, Razvan Teslaru wrote:
>
> PS: I have both cygwin python and Windows python installed on the same 
> machine, if relevant.
>
> On Thursday, August 29, 2013 3:29:53 PM UTC+2, Massimo Di Pierro wrote:
>>
>> I have experienced the same problem. Yet I do not have a windows/cygwin 
>> machine here to debug it. Can you help us and figure out exactly where in 
>> gluon/widget.py it gets stuck?
>>
>> On Thursday, 29 August 2013 08:04:26 UTC-5, Razvan Teslaru wrote:
>>>
>>> Update: I managed to trace execution in web2py.py until "import 
>>> gluon.widget" -- execution doesn't continue in web2py.py after that line, 
>>> but again, no error message.
>>>
>>> On Thursday, August 29, 2013 12:00:20 AM UTC+2, Razvan Teslaru wrote:

 Trying to run web2py under cygwin. Python 2.7.5 installed, plus all 
 necessary dependencies. 

 Downloaded and unzipped web2py_src.zip; when running ./web2py, it hangs 
 for a few seconds and then exits, without any message. Initially I thought 
 it might attempt (and fail) to spawn the GUI to get a password, but 
 starting it with -a 'passwd' yields the same behavior. 

 Tried uninstalling the cygwin python and using the regular Windows 
 python under Cygwin -- now it works as expected, so it appears to be a 
 Cygwin Python + web2py specific issue, but I'm not sure how to proceed 
 from 
 here, without any sort of error message.

>>>

-- 

--- 
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.


[web2py] Re: Help with deploying on nginx

2013-08-29 Thread Niphlod
what does uwsgi log show ?

On Thursday, August 29, 2013 8:18:02 PM UTC+2, Apple Mason wrote:
>
> I keep getting 502 Bad Gateway, and I'm not sure why. I followed the Nginx 
> deployment recipe on the website, with the following changes:
>
> /etc/uwsgi/web2py.xml: Used /var/www-data/web2py/ instead of 
> /home/www-data/web2py/
>
> nginx conf: server_name is my server ip (I don't have a domain name) 
> instead of $hostname. I also changed the location to /web2py instead of 
> root.
>
> Here is my nginx conf:
>
> server {
> listen 443 default_server ssl;
> server_name xxx.xxx.xxx.xxx;
> ssl_certificate /etc/nginx/ssl/server.crt;
> ssl_certificate_key /etc/nginx/ssl/server.key;
> ssl_prefer_server_ciphers on;
> ssl_session_cache shared:SSL:10m;
> ssl_session_timeout 10m;
> ssl_ciphers ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:DHE-DSS-AES256
> -SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA;
> ssl_protocols SSLv3 TLSv1;
> keepalive_timeout70;
> location /web2py {
> #uwsgi_pass  127.0.0.1:9001;
> uwsgi_pass  unix:///tmp/web2py.socket;
> include uwsgi_params;
> uwsgi_param UWSGI_SCHEME $scheme;
> uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
> }
> }
>
>
>
> I omitted http since I only want to test over https for now.
>
> Restarted both uwsgi and nginx in that order. uwsgi seems to find web2py 
> okay in their logs:
>
> announcing my loyalty to the Emperor...
> *** vassal web2py.xml is now loyal ***
>
>
> When I access "https:///web2py", I get the 502 error.
>
> Nginx error.log says:
>
> 2013/08/29 18:10:08 [error] 9793#0: *4 upstream prematurely closed 
> connection while reading response header from upstream, client: 
> xxx.xxx.xxx.xxx, server: xxx.xxx.xxx.xxx, request: "GET /web2py HTTP/1.1", 
> upstream: "uwsgi://unix:///tmp/web2py.socket:", host: "xxx.xxx.xxx.xxx.
>
> I'm running ubuntu 13.04 server, if that's any use.
>
>
>

-- 

--- 
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.


[web2py] Re: Help with deploying on nginx

2013-08-29 Thread Apple Mason
There's a lot of lines but here's a good portion of it:



*** Operational MODE: no-workers ***
spawned uWSGI master process (pid: 10483)
*** starting uWSGI Emperor ***
*** has_emperor mode detected (fd: 6) ***
[uWSGI] parsing config file web2py.xml
*** Starting uWSGI 1.2.3-debian (64bit) on [Thu Aug 29 18:25:59 2013] ***
compiled with version: 4.7.2 on 07 November 2012 03:49:52
detected number of CPU cores: 8
current working directory: /etc/uwsgi
detected binary path: /usr/bin/uwsgi-core
setgid() to 33
setuid() to 33
limiting address space of processes...
your process address space limit is 536870912 bytes (512 MB)
your memory page size is 4096 bytes
 *** WARNING: you have enabled harakiri without post buffering. Slow upload 
could be rejected on post-unbuffered webservers ***
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
uwsgi socket 0 bound to UNIX address /tmp/web2py.socket fd 3
your server socket listen backlog is limited to 100 connections
*** Operational MODE: preforking ***
mounting wsgihandler:application on /
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 10485)
spawned uWSGI worker 1 (pid: 10486, cores: 1)
set cpu affinity for worker 1 to 0
spawned uWSGI worker 2 (pid: 10487, cores: 1)
spawned uWSGI worker 1 (pid: 10486, cores: 1)
set cpu affinity for worker 1 to 0
spawned uWSGI worker 2 (pid: 10487, cores: 1)
set cpu affinity for worker 2 to 1spawned uWSGI worker 3 (pid: 10488, cores: 
1)
set cpu affinity for worker 3 to 2
spawned uWSGI worker 4 (pid: 10489, cores: 1)
*** Stats server enabled on /tmp/stats.socket fd: 16 ***
set cpu affinity for worker 4 to 3
-- unavailable modifier requested: 0 --
announcing my loyalty to the Emperor...
*** vassal web2py.xml is now loyal ***
-- unavailable modifier requested: 0 --
announcing my loyalty to the Emperor...
*** vassal web2py.xml is now loyal ***
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
announcing my loyalty to the Emperor...
*** vassal web2py.xml is now loyal ***
-- unavailable modifier requested: 0 --
announcing my loyalty to the Emperor...
*** vassal web2py.xml is now loyal ***
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --





On Thursday, August 29, 2013 3:10:20 PM UTC-4, Niphlod wrote:
>
> what does uwsgi log show ?
>
> On Thursday, August 29, 2013 8:18:02 PM UTC+2, Apple Mason wrote:
>>
>> I keep getting 502 Bad Gateway, and I'm not sure why. I followed the 
>> Nginx deployment recipe on the website, with the following changes:
>>
>> /etc/uwsgi/web2py.xml: Used /var/www-data/web2py/ instead of 
>> /home/www-data/web2py/
>>
>> nginx conf: server_name is my server ip (I don't have a domain name) 
>> instead of $hostname. I also changed the location to /web2py instead of 
>> root.
>>
>> Here is my nginx conf:
>>
>> server {
>> listen 443 default_server ssl;
>> server_name xxx.xxx.xxx.xxx;
>> ssl_certificate /etc/nginx/ssl/server.crt;
>> ssl_certificate_key /etc/nginx/ssl/server.key;
>> ssl_prefer_server_ciphers on;
>> ssl_session_cache shared:SSL:10m;
>> ssl_session_timeout 10m;
>> ssl_ciphers ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:DHE-DSS-
>> AES256-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA;
>> ssl_protocols SSLv3 TLSv1;
>> keepalive_timeout70;
>> location /web2py {
>> #uwsgi_pass  127.0.0.1:9001;
>> uwsgi_pass  unix:///tmp/web2py.socket;
>> include uwsgi_params;
>> uwsgi_param UWSGI_SCHEME $scheme;
>> uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
>> }
>> }
>>
>>
>>
>> I omitted http since I only want to test over https for now.
>>
>> Restarted both uwsgi and nginx in that order. uwsgi seems to find web2py 
>> okay in their logs:
>>
>> announcing my loyalty to the Emperor...
>> *** vassal web2py.xml is now loyal ***
>>
>>
>> When I access "https:///web2py", I get the 502 error.
>>
>> Nginx error.log says:
>>
>> 2013/08/29 18:10:08 [error] 9793#0: *4 upstream prematurely closed 
>> connection while reading response header from upstream, client: 
>> xxx.xxx.xxx.xxx, server: xxx.xxx.

[web2py] Re: Starting web2py fails silently with Cygwin python

2013-08-29 Thread Razvan Teslaru
Interesting; I tried following the solution outlined there (installed 
xinit, started X Server, export DISPLAY=:0.0), but the behavior remains 
exactly the same.

In any case, ./web2py -a "passwd" (which behaves the same way under X too) 
should not even attempt to bring up any GUI at all.

On Thursday, August 29, 2013 9:03:53 PM UTC+2, Niphlod wrote:
>
> isn't it related to tk and cygwin being a little bit stubborn ?
> see 
> http://stackoverflow.com/questions/9393462/cannot-launch-git-gui-using-cygwin-on-windows
>
> On Thursday, August 29, 2013 4:52:47 PM UTC+2, Razvan Teslaru wrote:
>>
>> PS: I have both cygwin python and Windows python installed on the same 
>> machine, if relevant.
>>
>> On Thursday, August 29, 2013 3:29:53 PM UTC+2, Massimo Di Pierro wrote:
>>>
>>> I have experienced the same problem. Yet I do not have a windows/cygwin 
>>> machine here to debug it. Can you help us and figure out exactly where in 
>>> gluon/widget.py it gets stuck?
>>>
>>> On Thursday, 29 August 2013 08:04:26 UTC-5, Razvan Teslaru wrote:

 Update: I managed to trace execution in web2py.py until "import 
 gluon.widget" -- execution doesn't continue in web2py.py after that line, 
 but again, no error message.

 On Thursday, August 29, 2013 12:00:20 AM UTC+2, Razvan Teslaru wrote:
>
> Trying to run web2py under cygwin. Python 2.7.5 installed, plus all 
> necessary dependencies. 
>
> Downloaded and unzipped web2py_src.zip; when running ./web2py, it 
> hangs for a few seconds and then exits, without any message. Initially I 
> thought it might attempt (and fail) to spawn the GUI to get a password, 
> but 
> starting it with -a 'passwd' yields the same behavior. 
>
> Tried uninstalling the cygwin python and using the regular Windows 
> python under Cygwin -- now it works as expected, so it appears to be a 
> Cygwin Python + web2py specific issue, but I'm not sure how to proceed 
> from 
> here, without any sort of error message.
>


-- 

--- 
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.


[web2py] Re: Webhosts for Web2py

2013-08-29 Thread Ykä Marjanen
Regarding pythonanywhere.com, what's the best way to run own background 
tasks? In the website they state 1-hour scheduled task, but I need to run 
multiple tasks almost real-time (e.g. sending registration emails and 
such). I've designed my website so that most tasks are queued and done in 
the background.

Ykä

On Thursday, August 29, 2013 9:33:36 AM UTC+3, Loïc wrote:
>
> My apps are hosted at pythonanywhere.com
> People there are very helpfull and responsive.
> I recommend it...
>
>
> Le mercredi 28 août 2013 16:41:25 UTC+2, Massimo Di Pierro a écrit :
>>
>> Answers below.
>>
>> On Tuesday, 27 August 2013 16:11:22 UTC-5, Vivek Jha wrote:
>>>
>>> I am new in web development and I have started with web2py and have 
>>> almost copleted reading the web2py book.
>>>
>>> Now few practical issues are coming up about which I don't have any 
>>> experience and that is chosing the right economical webhost.
>>>
>>> I think following suits my pocket:
>>> 1. Bluehost
>>> 2. Hostgator (mainly becuase they have presence in India as well)
>>> 3. Justhost. 
>>>
>>
>>> Do any of guys have any experience with these web hosts. As most of the 
>>> webhosts are still not able to see the world beyond PHP and wordpress they 
>>> have not mentioned python support specifically though they may be 
>>> supporting Python based applications internally.
>>>
>>> Questions:
>>> 1. Do the above webhosts will be able to support Web2Py with FastCGI.
>>>
>>
>> I just looked them up and they all they they do. They have instructions 
>> for Django. The same instructions apply to web2py except that 1) you do not 
>> need to install Django 2) you need to download and unzip web2py 3) you need 
>> to configure apache to point to the provided fcgihandler.py.
>>  
>>
>>> 2. Is having shell access a must for running web2py.
>>>
>>
>> You don't but it is convenient for maintenance. All the hosts you listed 
>> have a shell.
>>  
>>
>>> 3. Will it be possible to run Web2Py on the main domain and Wordpress on 
>>> subdomain or vice versa with them.
>>>
>>
>> That's an apache configuration issue. Yes you can. web2py does not care. 
>> If there is a path prefix you have to use routes.py to tell web2py to 
>> ignore the prefix.
>>  
>>
>>> 4. Whom to ask about WSGI setup? Is this a webshost specific question or 
>>> Web2Py specific.
>>>
>>
>> That's a host specific issue. It is unlikely shared hosts will support it.
>>  
>>
>>> If you think I have not asked the right questions, then please assume me 
>>> as a beginner in the hosting world and let me if there are any catches 
>>> about which I should be careful of.
>>>
>>
>> As a rule of thumb, if they have instructions for any other python 
>> framework you can do it with web2py too. We can help you convert the 
>> instructions. All python frameworks use the same standard mechanisms to 
>> talk to web servers. web2py is actually easier than others because you do 
>> not need root privileges to install it nor you need virtualenv. We also 
>> support all adapters: wsgi, fcgi, scgi, cgi, mod_python (discouraged), 
>> isapi (windows only). The real issue is, if they don't allow wsgi, than 
>> probably you need to run web2py using fcgi. This means you need to run your 
>> own long running process. What tools do they offer to do that (start, 
>> monitor, restart). Moreover if you later need a third party module that 
>> requires sudo access, will they install it for you? If they are mostly a 
>> Ruby or PHP shop, they will not help you much.  I have worked with 
>> pythonanywhere.com and they were very helpful and responsive.
>>
>

-- 

--- 
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.


[web2py] Re: Logged in dropdown links

2013-08-29 Thread Paolo Caruccio
Now in trunk, the auth navbar has a "bare" mode that should simplify its 
customization. For details please see 
https://github.com/web2py/web2py/pull/186

Il giorno mercoledì 28 agosto 2013 20:19:28 UTC+2, dirman ha scritto:
>
> is it posible to add another link to the logged in dropdown in adding to 
> the profile,password and logout links?
>

-- 

--- 
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.


[web2py] Re: Starting web2py fails silently with Cygwin python

2013-08-29 Thread Razvan Teslaru
Here is the stack trace:

  /usr/lib/python2.7/bdb.py(400)run()
-> exec cmd in globals, locals
  (1)()
  /home/eraztes/web2py/web2py.py(19)()
-> import gluon.widget
  /home/eraztes/web2py/gluon/__init__.py(15)()
-> from globals import current
  /home/eraztes/web2py/gluon/globals.py(21)()
-> from html import xmlescape, TABLE, TR, PRE, URL
  /home/eraztes/web2py/gluon/html.py(28)()
-> from utils import web2py_uuid, simple_hash, compare
  /home/eraztes/web2py/gluon/utils.py(16)()
-> import uuid
  
/usr/lib/python2.7/site-packages/uuid-1.30-py2.7.egg/uuid.py(353)()
-> if hasattr(lib, 'uuid_generate_random'):
  /usr/lib/python2.7/ctypes/__init__.py(378)__getattr__()
-> func = self.__getitem__(name)
> /usr/lib/python2.7/ctypes/__init__.py(383)__getitem__()
-> func = self._FuncPtr((name_or_ordinal, self))

-- execution stops here without any error message. Cannot 'step' further.

Full trace:

eraztes@mycomputer ~/web2py
$ python -m pdb web2py.py
> /home/eraztes/web2py/web2py.py(4)()
-> import os
(Pdb) next
> /home/eraztes/web2py/web2py.py(5)()
-> import sys
(Pdb)
> /home/eraztes/web2py/web2py.py(7)()
-> if '__file__' in globals():
(Pdb)
> /home/eraztes/web2py/web2py.py(8)()
-> path = os.path.dirname(os.path.abspath(__file__))
(Pdb)
> /home/eraztes/web2py/web2py.py(9)()
-> print "1"
(Pdb)
1
> /home/eraztes/web2py/web2py.py(14)()
-> os.chdir(path)
(Pdb)
> /home/eraztes/web2py/web2py.py(15)()
-> print path
(Pdb)
/home/eraztes/web2py
> /home/eraztes/web2py/web2py.py(16)()
-> sys.path = [path] + [p for p in sys.path if not p == path]
(Pdb)
> /home/eraztes/web2py/web2py.py(16)()
-> sys.path = [path] + [p for p in sys.path if not p == path]
(Pdb)
> /home/eraztes/web2py/web2py.py(16)()
-> sys.path = [path] + [p for p in sys.path if not p == path]
(Pdb)
> /home/eraztes/web2py/web2py.py(16)()
-> sys.path = [path] + [p for p in sys.path if not p == path]
(Pdb)
> /home/eraztes/web2py/web2py.py(16)()
-> sys.path = [path] + [p for p in sys.path if not p == path]
(Pdb)
> /home/eraztes/web2py/web2py.py(16)()
-> sys.path = [path] + [p for p in sys.path if not p == path]
(Pdb)
> /home/eraztes/web2py/web2py.py(16)()
-> sys.path = [path] + [p for p in sys.path if not p == path]
(Pdb)
> /home/eraztes/web2py/web2py.py(16)()
-> sys.path = [path] + [p for p in sys.path if not p == path]
(Pdb)
> /home/eraztes/web2py/web2py.py(16)()
-> sys.path = [path] + [p for p in sys.path if not p == path]
(Pdb)
> /home/eraztes/web2py/web2py.py(16)()
-> sys.path = [path] + [p for p in sys.path if not p == path]
(Pdb)
> /home/eraztes/web2py/web2py.py(16)()
-> sys.path = [path] + [p for p in sys.path if not p == path]
(Pdb)
> /home/eraztes/web2py/web2py.py(16)()
-> sys.path = [path] + [p for p in sys.path if not p == path]
(Pdb)
> /home/eraztes/web2py/web2py.py(17)()
-> print sys.path
(Pdb)
['/home/eraztes/web2py', '', 
'/usr/lib/python2.7/site-packages/uuid-1.30-py2.7.egg', 
'/usr/lib/python27.zip', '/usr/lib/python2.7', 
'/usr/lib/python2.7/plat-cygwin', '/usr/lib/python2.7/lib-tk', 
'/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', 
'/usr/lib/python2.7/site-packages', 
'/usr/lib/python2.7/site-packages/gtk-2.0', 
'/usr/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info']
> /home/eraztes/web2py/web2py.py(19)()
-> import gluon.widget
(Pdb) step
--Call--
> /home/eraztes/web2py/gluon/__init__.py(11)()
-> """
(Pdb)
> /home/eraztes/web2py/gluon/__init__.py(11)()
-> """
(Pdb)
> /home/eraztes/web2py/gluon/__init__.py(13)()
-> __all__ = ['A', 'B', 'BEAUTIFY', 'BODY', 'BR', 'CAT', 'CENTER', 
'CLEANUP', 'CODE', 'CRYPT', 'DAL', 'DIV', 'EM', 'EMBED', 'FIELDSET', 
'FORM', 'Field', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'HEAD', 'HR', 'HTML', 
'HTTP', 'I', 'IFRAME', 'IMG', 'INPUT', 'IS_ALPHANUMERIC', 'IS_DATE', 
'IS_DATETIME', 'IS_DATETIME_IN_RANGE', 'IS_DATE_IN_RANGE', 
'IS_DECIMAL_IN_RANGE', 'IS_EMAIL', 'IS_EMPTY_OR', 'IS_EQUAL_TO', 'IS_EXPR', 
'IS_FLOAT_IN_RANGE', 'IS_IMAGE', 'IS_JSON', 'IS_INT_IN_RANGE', 'IS_IN_DB', 
'IS_IN_SET', 'IS_IPV4', 'IS_LENGTH', 'IS_LIST_OF', 'IS_LOWER', 'IS_MATCH', 
'IS_NOT_EMPTY', 'IS_NOT_IN_DB', 'IS_NULL_OR', 'IS_SLUG', 'IS_STRONG', 
'IS_TIME', 'IS_UPLOAD_FILENAME', 'IS_UPPER', 'IS_URL', 'LABEL', 'LEGEND', 
'LI', 'LINK', 'LOAD', 'MARKMIN', 'MENU', 'META', 'OBJECT', 'OL', 'ON', 
'OPTGROUP', 'OPTION', 'P', 'PRE', 'SCRIPT', 'SELECT', 'SPAN', 'SQLFORM', 
'SQLTABLE', 'STRONG', 'STYLE', 'TABLE', 'TAG', 'TBODY', 'TD', 'TEXTAREA', 
'TFOOT', 'TH', 'THEAD', 'TITLE', 'TR', 'TT', 'UL', 'URL', 'XHTML', 'XML', 
'redirect', 'current', 'embed64']
(Pdb)
> /home/eraztes/web2py/gluon/__init__.py(15)()
-> from globals import current
(Pdb)
--Call--
> /home/eraztes/web2py/gluon/globals.py(15)()
-> """
(Pdb)
> /home/eraztes/web2py/gluon/globals.py(15)()
-> """
(Pdb)
> /home/eraztes/web2py/gluon/globals.py(17)()
-> from storage import Storage, List
(Pdb)
--Call--
> /home/eraztes/web2py/gluon/storage.py(13)()
-> """
(Pdb)
> /home/eraztes/web2py/gluon/storage.py(13)()
-> """
(Pdb)
> /home/eraztes/web2py/gluon/storage.py(15)()
-> import cPi

Re: [web2py] Smartgrid line color

2013-08-29 Thread António Ramos
Many thanks for your time.
I will think about it tomorrorw.



2013/8/29 Roberto Perdomo 

> Hi António,
>
> You can use a conditional represent to change the color of the date field
> in your outdated record.
>
> something like:
>
> 1) db.table.field.represent =lambda value, row: " COLOR='red'>"+value+"" if CONDITION else value
>
> Or you can put the outdated field inside an specific div with an id and
> iterate over the smartgrid table with Jquery to find the id, I Jquery find
> the id, then change the row color:
>
> 2) db.table.field.represent =lambda value, row: " id='outdated'>"+value+"" if CONDITION else value
>
> I used something like the option 1, but I can not find the project at this
> moment.
>
>
>
>
> 2013/8/29 António Ramos 
>
>> Hello ,
>>
>> i need a table (smartgrid) that highlights outdated records, for example
>> forcing the outdated record line inside the table to be filled with red
>> background and yellow text.
>>
>>
>> Can i do it with form.smartgrid?
>>
>>
>> Thank you
>> António
>>
>> --
>>
>> ---
>> 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.
>>
>
>  --
>
> ---
> 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.
>

-- 

--- 
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.


[web2py] Re: Is there an issue with my web2py install? "can't pickle function objects"

2013-08-29 Thread Frederick Yankowski
I have opened https://code.google.com/p/web2py/issues/detail?id=1655 about 
this problem.

-- 

--- 
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.


[web2py] Re: Webhosts for Web2py

2013-08-29 Thread Anthony
You might consider Digital Ocean  (just 
moved there from Amazon) -- $5/month gets you quite a bit, and for an extra 
$1 you get backups. Data centers in New York, San Francisco, and Amsterdam.

Anthony

On Tuesday, August 27, 2013 2:11:22 PM UTC-7, Vivek Jha wrote:
>
> I am new in web development and I have started with web2py and have almost 
> copleted reading the web2py book.
>
> Now few practical issues are coming up about which I don't have any 
> experience and that is chosing the right economical webhost.
>
> I think following suits my pocket:
> 1. Bluehost
> 2. Hostgator (mainly becuase they have presence in India as well)
> 3. Justhost.
>
> Do any of guys have any experience with these web hosts. As most of the 
> webhosts are still not able to see the world beyond PHP and wordpress they 
> have not mentioned python support specifically though they may be 
> supporting Python based applications internally.
>
> Questions:
> 1. Do the above webhosts will be able to support Web2Py with FastCGI.
> 2. Is having shell access a must for running web2py.
> 3. Will it be possible to run Web2Py on the main domain and Wordpress on 
> subdomain or vice versa with them.
> 4. Whom to ask about WSGI setup? Is this a webshost specific question or 
> Web2Py specific.
>
> If you think I have not asked the right questions, then please assume me 
> as a beginner in the hosting world and let me if there are any catches 
> about which I should be careful of.
>

-- 

--- 
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.


[web2py] Re: Logged in dropdown links

2013-08-29 Thread dirman
Thank you.

On Wednesday, August 28, 2013 6:19:28 PM UTC, dirman wrote:
>
> is it posible to add another link to the logged in dropdown in adding to 
> the profile,password and logout links?
>

-- 

--- 
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.


Re: [web2py] Re: Latest Trunk - problem with auth(session) and login using 'remember me'

2013-08-29 Thread Marin Pranjić
*bump*




On Thu, Aug 22, 2013 at 4:07 PM, Michele Comitini <
michele.comit...@gmail.com> wrote:

> Marin,
>
> I agree there is something wrong there
>
>
> 2013/8/22 Marin Pranjić 
>
>> What's with the line 1018?
>>
>>
>> https://github.com/web2py/web2py/blob/5d67db3bfd15a00403d3e0b94fe9175935d007d2/gluon/globals.py#L1018
>>
>>
>> On Thu, Aug 22, 2013 at 11:36 AM, Massimo Di Pierro <
>> massimo.dipie...@gmail.com> wrote:
>>
>>> Please try again. Thanks for checking this.
>>>
>>>
>>> On Thursday, 22 August 2013 03:29:03 UTC-5, szimszon wrote:

 Hi!

 It's still broken for me.

 googlecode 7a1ff6228799

 I have a session in db. If I didn't check the Remember me than I get

 Traceback (most recent call last):
   File "/home/gyszabolcs/fejlesztes/**web2py/gluon/restricted.py",
 line 217, in restricted
 exec ccode in environment
   File 
 "/home/gyszabolcs/fejlesztes/**web2py/applications/web2print/**controllers/default.py",
 line 134, in 
   File "/home/gyszabolcs/fejlesztes/**web2py/gluon/globals.py", line
 358, in 
 self._caller = lambda f: f()
   File 
 "/home/gyszabolcs/fejlesztes/**web2py/applications/web2print/**controllers/default.py",
 line 17, in user
 return dict(form=auth())
   File "/home/gyszabolcs/fejlesztes/**web2py/gluon/tools.py", line
 1293, in __call__
 return getattr(self, args[0])()
   File "/home/gyszabolcs/fejlesztes/**web2py/gluon/tools.py", line
 2249, in login
 self.login_user(user)
   File "/home/gyszabolcs/fejlesztes/**web2py/gluon/tools.py", line
 1871, in login_user
 current.session.renew(clear_**session=not
 self.settings.keep_session_**onlogin)
   File "/home/gyszabolcs/fejlesztes/**web2py/gluon/globals.py", line
 889, in renew
 rows = db(table.id==record_id)(table.**unique_key==unique_key)\
 NameError: global name 'db' is not defined

 In a model:

 db = DAL(settings.database_uri, pool_size=2)
 session.connect(request, response, db=db)

 2013. augusztus 22., csütörtök 9:37:22 UTC+2 időpontban Massimo Di
 Pierro a következőt írta:
>
> I think it is solved in trunk (committed to googlecode only, github is
> down today).
>
> On Thursday, 22 August 2013 02:16:20 UTC-5, David Marko wrote:
>>
>> I know there are some changes in session internals in trunk, so just
>> reporting an issue I observed. When I login using 'Remember me' checked,
>> I'm getting this error below. Without 'remember me' its working just 
>> fine.
>> I tried to remove all session files but still the same consistent 
>> behaviour
>> ...
>>
>> Traceback
>>
>>
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>>
>>
>>
>> Traceback (most recent call last):
>>   File "C:\java\web2py\gluon\**restricted.py", line 217, in restricted
>>
>>
>>
>>
>> exec ccode in environment
>>   File "C:/java/web2py/applications/**gapps/models/03_db.py" 
>> ,
>>  line 49, in 
>>
>>
>>
>>
>> auth = Auth(db)
>>   File "C:\java\web2py\gluon\tools.**py", line 1229, in __init__
>>
>>
>>
>>
>> auth.expiration
>> KeyError: 'session_id_gapps'
>>
>> Error snapshot [image: 
>> help]
>>
>> ('**session_id_gapps')
>>
>> inspect attributes
>>  Frames
>>
>>-
>>
>>*File C:\java\web2py\gluon\restricted.py in restricted at line 217
>>* code arguments variables
>>-
>>
>>*File C:\java\web2py\applications\gapps\models\03_db.py in
>> at line 49* code arguments variables
>>-
>>
>>*File C:\java\web2py\gluon\tools.py in __init__ at line 1229* code
>> arguments variables
>>Function argument list
>>
>>(self=, environment=>uri="sqlite://storage.sqlite">**, db=>uri="sqlite://storage.sqlite">**, mailer=True, hmac_key=None,
>>controller='default', function='user', cas_provider=None, 
>> signature=True,
>>secure=False)
>>Code listing
>>
>>
>>
>>
>>1224.
>>1225.
>>1226.
>>1227.
>>1228.
>>1229.
>>
>>1230.
>>1231.
>>1232.
>>1233.
>>
>>
>>
>># for "remember me" option
>>response = current.response
>>
>>
>>
>>
>>if auth and auth.remember:
>>
>>
>>
>>
>># when user wants to be logged in for longer
>>response.cookies[response.sess**ion_id_na

[web2py] Re: Help with deploying on nginx

2013-08-29 Thread Niphlod
http://stackoverflow.com/questions/10748108/nginx-uwsgi-unavailable-modifier-requested-0

its better to build uwsgi from source, so you dont' get caught in this 
crazy-organized apt packages.

On Thursday, August 29, 2013 9:18:45 PM UTC+2, Apple Mason wrote:
>
> There's a lot of lines but here's a good portion of it:
>
>
>
> *** Operational MODE: no-workers ***
> spawned uWSGI master process (pid: 10483)
> *** starting uWSGI Emperor ***
> *** has_emperor mode detected (fd: 6) ***
> [uWSGI] parsing config file web2py.xml
> *** Starting uWSGI 1.2.3-debian (64bit) on [Thu Aug 29 18:25:59 2013] ***
> compiled with version: 4.7.2 on 07 November 2012 03:49:52
> detected number of CPU cores: 8
> current working directory: /etc/uwsgi
> detected binary path: /usr/bin/uwsgi-core
> setgid() to 33
> setuid() to 33
> limiting address space of processes...
> your process address space limit is 536870912 bytes (512 MB)
> your memory page size is 4096 bytes
>  *** WARNING: you have enabled harakiri without post buffering. Slowupload 
> could be rejected on post
> -unbuffered webservers ***
> detected max file descriptor number: 1024
> lock engine: pthread robust mutexes
> uwsgi socket 0 bound to UNIX address /tmp/web2py.socket fd 3
> your server socket listen backlog is limited to 100 connections
> *** Operational MODE: preforking ***
> mounting wsgihandler:application on /
> *** no app loaded. going in full dynamic mode ***
> *** uWSGI is running in multiple interpreter mode ***
> spawned uWSGI master process (pid: 10485)
> spawned uWSGI worker 1 (pid: 10486, cores: 1)
> set cpu affinity for worker 1 to 0
> spawned uWSGI worker 2 (pid: 10487, cores: 1)
> spawned uWSGI worker 1 (pid: 10486, cores: 1)
> set cpu affinity for worker 1 to 0
> spawned uWSGI worker 2 (pid: 10487, cores: 1)
> set cpu affinity for worker 2 to 1spawned uWSGI worker 3 (pid: 10488,cores
> : 1)
> set cpu affinity for worker 3 to 2
> spawned uWSGI worker 4 (pid: 10489, cores: 1)
> *** Stats server enabled on /tmp/stats.socket fd: 16 ***
> set cpu affinity for worker 4 to 3
> -- unavailable modifier requested: 0 --
> announcing my loyalty to the Emperor...
> *** vassal web2py.xml is now loyal ***
> -- unavailable modifier requested: 0 --
> announcing my loyalty to the Emperor...
> *** vassal web2py.xml is now loyal ***
> -- unavailable modifier requested: 0 --
> -- unavailable modifier requested: 0 --
> announcing my loyalty to the Emperor...
> *** vassal web2py.xml is now loyal ***
> -- unavailable modifier requested: 0 --
> announcing my loyalty to the Emperor...
> *** vassal web2py.xml is now loyal ***
> -- unavailable modifier requested: 0 --
> -- unavailable modifier requested: 0 --
> -- unavailable modifier requested: 0 --
> -- unavailable modifier requested: 0 --
> -- unavailable modifier requested: 0 --
> -- unavailable modifier requested: 0 --
> -- unavailable modifier requested: 0 --
> -- unavailable modifier requested: 0 --
> -- unavailable modifier requested: 0 --
> -- unavailable modifier requested: 0 --
> -- unavailable modifier requested: 0 --
> -- unavailable modifier requested: 0 --
> -- unavailable modifier requested: 0 --
> -- unavailable modifier requested: 0 --
> -- unavailable modifier requested: 0 --
> -- unavailable modifier requested: 0 --
> -- unavailable modifier requested: 0 --
> -- unavailable modifier requested: 0 --
> -- unavailable modifier requested: 0 --
>
>
>
>
>
> On Thursday, August 29, 2013 3:10:20 PM UTC-4, Niphlod wrote:
>>
>> what does uwsgi log show ?
>>
>> On Thursday, August 29, 2013 8:18:02 PM UTC+2, Apple Mason wrote:
>>>
>>> I keep getting 502 Bad Gateway, and I'm not sure why. I followed the 
>>> Nginx deployment recipe on the website, with the following changes:
>>>
>>> /etc/uwsgi/web2py.xml: Used /var/www-data/web2py/ instead of 
>>> /home/www-data/web2py/
>>>
>>> nginx conf: server_name is my server ip (I don't have a domain name) 
>>> instead of $hostname. I also changed the location to /web2py instead of 
>>> root.
>>>
>>> Here is my nginx conf:
>>>
>>> server {
>>> listen 443 default_server ssl;
>>> server_name xxx.xxx.xxx.xxx;
>>> ssl_certificate /etc/nginx/ssl/server.crt;
>>> ssl_certificate_key /etc/nginx/ssl/server.key;
>>> ssl_prefer_server_ciphers on;
>>> ssl_session_cache shared:SSL:10m;
>>> ssl_session_timeout 10m;
>>> ssl_ciphers ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:DHE-DSS-
>>> AES256-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA;
>>> ssl_protocols SSLv3 TLSv1;
>>> keepalive_timeout70;
>>> location /web2py {
>>> #uwsgi_pass  127.0.0.1:9001;
>>> uwsgi_pass  unix:///tmp/web2py.socket;
>>> include uwsgi_params;
>>> uwsgi_param UWSGI_SCHEME $scheme;
>>> uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
>>> }
>>> }
>>>
>>>
>>>
>>> I omitted http since I only want to test over https for now.
>>>
>

[web2py] Re: Starting web2py fails silently with Cygwin python

2013-08-29 Thread Massimo Di Pierro
I think the version in trunk (and the nightly build) does not.

On Thursday, 29 August 2013 14:36:03 UTC-5, Razvan Teslaru wrote:
>
> Interesting; I tried following the solution outlined there (installed 
> xinit, started X Server, export DISPLAY=:0.0), but the behavior remains 
> exactly the same.
>
> In any case, ./web2py -a "passwd" (which behaves the same way under X too) 
> should not even attempt to bring up any GUI at all.
>
> On Thursday, August 29, 2013 9:03:53 PM UTC+2, Niphlod wrote:
>>
>> isn't it related to tk and cygwin being a little bit stubborn ?
>> see 
>> http://stackoverflow.com/questions/9393462/cannot-launch-git-gui-using-cygwin-on-windows
>>
>> On Thursday, August 29, 2013 4:52:47 PM UTC+2, Razvan Teslaru wrote:
>>>
>>> PS: I have both cygwin python and Windows python installed on the same 
>>> machine, if relevant.
>>>
>>> On Thursday, August 29, 2013 3:29:53 PM UTC+2, Massimo Di Pierro wrote:

 I have experienced the same problem. Yet I do not have a windows/cygwin 
 machine here to debug it. Can you help us and figure out exactly where in 
 gluon/widget.py it gets stuck?

 On Thursday, 29 August 2013 08:04:26 UTC-5, Razvan Teslaru wrote:
>
> Update: I managed to trace execution in web2py.py until "import 
> gluon.widget" -- execution doesn't continue in web2py.py after that line, 
> but again, no error message.
>
> On Thursday, August 29, 2013 12:00:20 AM UTC+2, Razvan Teslaru wrote:
>>
>> Trying to run web2py under cygwin. Python 2.7.5 installed, plus all 
>> necessary dependencies. 
>>
>> Downloaded and unzipped web2py_src.zip; when running ./web2py, it 
>> hangs for a few seconds and then exits, without any message. Initially I 
>> thought it might attempt (and fail) to spawn the GUI to get a password, 
>> but 
>> starting it with -a 'passwd' yields the same behavior. 
>>
>> Tried uninstalling the cygwin python and using the regular Windows 
>> python under Cygwin -- now it works as expected, so it appears to be a 
>> Cygwin Python + web2py specific issue, but I'm not sure how to proceed 
>> from 
>> here, without any sort of error message.
>>
>

-- 

--- 
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.


[web2py] Re: Is there an issue with my web2py install? "can't pickle function objects"

2013-08-29 Thread Massimo Di Pierro
Should be fixed. Can you check?

On Thursday, 29 August 2013 15:52:07 UTC-5, Frederick Yankowski wrote:
>
> I have opened https://code.google.com/p/web2py/issues/detail?id=1655 about 
> this problem.
>
>

-- 

--- 
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.


[web2py] 'is of type integer but expression is of type character varying'?

2013-08-29 Thread Auden RovelleQuartz
I added the "timestamp" field to the table:

{

*db.define_table("auction_item_bids_lexa",*
*Field("bidder"),*
*Field("block_size"),*
*Field("bid_per_block","integer", default = 0),*
*Field("number_of_blocks"),*
*Field("timestamp","datetime"),*
* ) #CDN-000275*

}


the started having issues - - -does anyone here understand what the fix to 
the following could be?

Here is the traceback:

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.

Traceback (most recent call last):
  File "/home/www-data/web2py/gluon/restricted.py", line 212, in restricted
exec ccode in environment
  File "/home/www-data/web2py/applications/omniavx/models/db.py" 
, line 148, in 
Field("timestamp","datetime"),
  File "/home/www-data/web2py/gluon/dal.py", line 7788, in define_table
table = self.lazy_define_table(tablename,*fields,**args)
  File "/home/www-data/web2py/gluon/dal.py", line 7825, in lazy_define_table
polymodel=polymodel)
  File "/home/www-data/web2py/gluon/dal.py", line 991, in create_table
fake_migrate=fake_migrate)
  File "/home/www-data/web2py/gluon/dal.py", line 1094, in migrate_table
self.execute(sub_query)
  File "/home/www-data/web2py/gluon/dal.py", line 1784, in execute
return self.log_execute(*a, **b)
  File "/home/www-data/web2py/gluon/dal.py", line 1778, in log_execute
ret = self.cursor.execute(command, *a[1:], **b)
  File "/home/www-data/web2py/gluon/contrib/pg8000/dbapi.py", line 246, in _fn
return fn(self, *args, **kwargs)
  File "/home/www-data/web2py/gluon/contrib/pg8000/dbapi.py", line 317, in 
execute
self._execute(operation, args)
  File "/home/www-data/web2py/gluon/contrib/pg8000/dbapi.py", line 322, in 
_execute
self.cursor.execute(new_query, *new_args)
  File "/home/www-data/web2py/gluon/contrib/pg8000/interface.py", line 398, in 
execute
self._stmt = PreparedStatement(self.connection, query, statement_name="", 
*[{"type": type(x), "value": x} for x in args])
  File "/home/www-data/web2py/gluon/contrib/pg8000/interface.py", line 138, in 
__init__
self._parse_row_desc = self.c.parse(self._statement_name, statement, types)
  File "/home/www-data/web2py/gluon/contrib/pg8000/protocol.py", line 943, in 
_fn
return fn(self, *args, **kwargs)
  File "/home/www-data/web2py/gluon/contrib/pg8000/protocol.py", line 1104, in 
parse
return reader.handle_messages()
  File "/home/www-data/web2py/gluon/contrib/pg8000/protocol.py", line 929, in 
handle_messages
raise exc
ProgrammingError: ('ERROR', '42804', 'column "bid_per_block__tmp" is of type 
integer but expression is of type character varying')

-- 

--- 
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.