Re: [web2py] Re: Tags output by Python in views problem

2013-06-15 Thread Alexei Vinidiktov
I've figured it out. It's working consistently on all my setups, it was a
misunderstanding on my part.

Some html was only output if the code was run on the remote server, so I
didn't see the escaping on the local server.


On Sun, Jun 16, 2013 at 10:02 AM, Anthony  wrote:

> You're sure it's the exact same code?
>
>
> On Saturday, June 15, 2013 10:06:30 PM UTC-4, Alexei Vinidiktov wrote:
>
>> Thank you, Anthony. It solves the problem.
>>
>> But I don't understand why I'm not seeing the escaping in my other
>> setups.
>>
>> On 16.06.2013, at 8:56, Anthony  wrote:
>>
>> You should see the escaping in any environment. To avoid it:
>>
>> {{=XML("Some text here")}}
>>
>> Anthony
>>
>> On Saturday, June 15, 2013 9:20:26 PM UTC-4, Alexei Vinidiktov wrote:
>>>
>>> Hello,
>>>
>>> I'm having a weird encoding problem in views.
>>>
>>> If I display html code like this in a view:
>>>
>>> {{= "Some text here"
>>> }}
>>>
>>> it comes out like this on the resulting page:
>>>
>>> Some text here
>>>
>>> instead of
>>>
>>> Some text here
>>>
>>> The problem setup is Ubuntu 13.04 64 bit, Python 2.7.4, web2py 2.5.1,
>>> nginx 1.2.6, uwsgi 1.9.12
>>>
>>> But it seems to work  fine on my other setups: Windows, Mac, even
>>> another Ubuntu version (12.04, 32 bit with Apache and Python 2.7.1).
>>>
>>>
>>> --
>>> Alexei Vinidiktov
>>>
>>  --
>>
>> ---
>> 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.
>
>
>



-- 
Alexei Vinidiktov

-- 

--- 
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: Tags output by Python in views problem

2013-06-15 Thread Anthony
You're sure it's the exact same code?

On Saturday, June 15, 2013 10:06:30 PM UTC-4, Alexei Vinidiktov wrote:
>
> Thank you, Anthony. It solves the problem. 
>
> But I don't understand why I'm not seeing the escaping in my other setups. 
>
> On 16.06.2013, at 8:56, Anthony > wrote:
>
> You should see the escaping in any environment. To avoid it:
>
> {{=XML("Some text here")}}
>
> Anthony
>
> On Saturday, June 15, 2013 9:20:26 PM UTC-4, Alexei Vinidiktov wrote:
>>
>> Hello,
>>
>> I'm having a weird encoding problem in views.
>>
>> If I display html code like this in a view:
>>
>> {{= "Some text here"
>> }}
>>
>> it comes out like this on the resulting page:
>>
>> Some text here
>>
>> instead of 
>>
>> Some text here
>>
>> The problem setup is Ubuntu 13.04 64 bit, Python 2.7.4, web2py 2.5.1, 
>> nginx 1.2.6, uwsgi 1.9.12
>>
>> But it seems to work  fine on my other setups: Windows, Mac, even another 
>> Ubuntu version (12.04, 32 bit with Apache and Python 2.7.1). 
>>
>>
>> -- 
>> Alexei Vinidiktov 
>>
>  -- 
>  
> --- 
> 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] Re: Tags output by Python in views problem

2013-06-15 Thread Alexei Vinidiktov
Thank you, Anthony. It solves the problem. 

But I don't understand why I'm not seeing the escaping in my other setups. 

On 16.06.2013, at 8:56, Anthony  wrote:

> You should see the escaping in any environment. To avoid it:
> 
> {{=XML("Some text here")}}
> 
> Anthony
> 
> On Saturday, June 15, 2013 9:20:26 PM UTC-4, Alexei Vinidiktov wrote:
>> 
>> Hello,
>> 
>> I'm having a weird encoding problem in views.
>> 
>> If I display html code like this in a view:
>> 
>> {{= "Some text here"
>> }}
>> 
>> it comes out like this on the resulting page:
>> 
>> Some text here
>> 
>> instead of 
>> 
>> Some text here
>> 
>> The problem setup is Ubuntu 13.04 64 bit, Python 2.7.4, web2py 2.5.1, nginx 
>> 1.2.6, uwsgi 1.9.12
>> 
>> But it seems to work  fine on my other setups: Windows, Mac, even another 
>> Ubuntu version (12.04, 32 bit with Apache and Python 2.7.1). 
>> 
>> 
>> -- 
>> Alexei Vinidiktov
> 
> -- 
>  
> --- 
> 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: Tags output by Python in views problem

2013-06-15 Thread Anthony
You should see the escaping in any environment. To avoid it:

{{=XML("Some text here")}}

Anthony

On Saturday, June 15, 2013 9:20:26 PM UTC-4, Alexei Vinidiktov wrote:
>
> Hello,
>
> I'm having a weird encoding problem in views.
>
> If I display html code like this in a view:
>
> {{= "Some text here"
> }}
>
> it comes out like this on the resulting page:
>
> Some text here
>
> instead of 
>
> Some text here
>
> The problem setup is Ubuntu 13.04 64 bit, Python 2.7.4, web2py 2.5.1, 
> nginx 1.2.6, uwsgi 1.9.12
>
> But it seems to work  fine on my other setups: Windows, Mac, even another 
> Ubuntu version (12.04, 32 bit with Apache and Python 2.7.1). 
>
>
> -- 
> Alexei Vinidiktov 
>

-- 

--- 
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] Tags output by Python in views problem

2013-06-15 Thread Alexei Vinidiktov
Hello,

I'm having a weird encoding problem in views.

If I display html code like this in a view:

{{= "Some text here"
}}

it comes out like this on the resulting page:

Some text here

instead of

Some text here

The problem setup is Ubuntu 13.04 64 bit, Python 2.7.4, web2py 2.5.1, nginx
1.2.6, uwsgi 1.9.12

But it seems to work  fine on my other setups: Windows, Mac, even another
Ubuntu version (12.04, 32 bit with Apache and Python 2.7.1).


-- 
Alexei Vinidiktov

-- 

--- 
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: example for validating input (using requires = IS_IN_DB) against form.vars before submit.

2013-06-15 Thread webpypy



  I am looking for an example for validating input (using requires = 
> IS_IN_DB) against form.vars before submit.
>

  You mean you want to test an html form values to match a set of db 
values client-side?

I am trying to have a form with three fields,
the first one needs to to validated against data base (this can be done in 
the controller by field1.requires = IS_IN_DB(...)) , 
the second one needs to be validated against data base and the entered 
value of field1 ( field2.requires = IS_IN_DB(.form.vars.field1.))

I am generating the form using SQLFORM.






-- 

--- 
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] websockets

2013-06-15 Thread shartha
Hi Ricardo. I would love to have a functional example. Could you please 
make one?

Thanks!

On Friday, June 14, 2013 3:50:08 PM UTC-5, Ricardo Pedroso wrote:
>
>
>
>
> On Fri, Jun 14, 2013 at 2:36 AM, shartha 
> > wrote:
>
>> Hello. Some questions about websockets:
>> 1) Can websockets be implemented within web2py without any in-socket 
>> server side component?
>
>  
> Yes. Runnig web2py with gevent or eventlet 
>
> If you want I can post an example using socketio.
>
> Ricardo
>

-- 

--- 
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 to many skills matrix

2013-06-15 Thread villas
As Alan says,  you don't seem to have a score field.  Maybe try this:

db.define_table('online_team',
Field('first_name', notnull=True),
Field('last_name', notnull=True),
Field('email', requires=IS_EMAIL(), notnull=True, unique=True),
Field('initials', notnull=True, unique=True))
format='%(initials)s')

db.define_table('skills',
Field('skill', notnull=True, unique=True)
format='%(skill)s')

db.define_table('ownership',
Field('initials', db.online_team),
Field('skill', db.skills)
Field('score', 'integer'))

Maybe look at the smartgrid to get something going fast. 

-- 

--- 
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: Simple way to start a minimal web2py view and table border problem

2013-06-15 Thread villas
>> Another problem is  not working.

Yes, whenever "html attributes" clash with "css",  it seems the latter will 
win.
Html attributes are definitely out of fashion!

-- 

--- 
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: [web2py-dev] Re: Spammers on web2pyslices.com

2013-06-15 Thread villas
> rephrasing. honeypot field (i.e. hidden from users, needs to be empty, 
usually filled by bots) is the "simplier implementation".

> If users programming bots wants to tackle your site, they find the 
> honeypot pretty easily and then code accordingly, so back to square 

1.
>

My experience is this: if the "users programming bots" attack your site 
then you are dealing with a human and CAPTCHAs are irrelevant.  We are 
dealing with bots here.  Honeypot empty field seemed to be OK once,  but 
not now.


Second one is js execution. This is effectively mitigating a lot (>90%) of 
> attempts on the aforementioned site. 
> I don't know why you state that js verification can be passed by bots... 
> usually they don't want to waste cpu resources loading a full js 
> environment (spidermonkey, phantomjs) just to crack your site (that's the 
> other <10%)
>
>
I believe most bots initially bypass JS by ignoring it -- they detect the 
fields and how they are submitted and then just try to whizz off some 
data.  The spammers are just building on to that basic approach to defeat 
the most obvious defences.  e.g. The empty honeypot field.  

However,  there are still very effective ways of obfuscating the form with 
JS.  The added JS checkbox is currently very effective.  I would recommend 
that as a minimally obtrusive test.  However,  I also think the spambots 
will eventually start looking out for that one too.
http://uxmovement.com/forms/captchas-vs-spambots-why-the-checkbox-captcha-wins/

For a slightly more obtrusive test the Qs and As are good.  The obvious 
ones are static prompts,  e.g. What is the sum of 3 and 2?  I had good 
success with that.  for a while,  but some spambots seem to look for that 
now.  I currently have total success with my random Qs and As and I can 
totally change these if and when the spambots catch up.   

I like the 5 secs idea -- I never thought of that!

Summary:
1. I would try the JS checkbox, 5 secs delay,  and/or look at my Qs and As 
implementation.
2. Failing that you have to fall back to:  increasingly complex image 
CAPTCHAs, Login, Moderation and Askimet solutions etc.

If the spambot programmers target your site (and let's face it, they would 
only do so if you are a worthy target),  you have to work with the second 
group anyway :(

-- 

--- 
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 to many skills matrix

2013-06-15 Thread Alan Etkin


>  I have a group of employees and a set of skills. One employee can have 
> many skills and one skill can be had by many employees. What I want to do 
> is to represent the skills of all employees in one table, where the score 
> of each employee in each skill is given on a scale from 0 to 5 like:
>

I think that given your model, you need a score field in the ownership 
table so you can retrieve each team member's score for every skill name 
when filling the score table

Then it's matter of building a custom html table with the TABLE helper that 
probably will involve using nested recordset loops.

-- 

--- 
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: [web2py-dev] Re: Spammers on web2pyslices.com

2013-06-15 Thread Alan Etkin

>
> almost forgot. Second step is actually to add a time verification to see 
> if user opened the comment form at least 5 seconds before posting.
>

web2py could use this default validators, as long as they can actually be 
implemented:

db.auth_user.email.requires = IS_NOT_SPAMMER(...)
db...requires = IS_NOT_SPAM(...)

using one or more of the resources posted in this thread

-- 

--- 
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: [web2py-dev] Re: Spammers on web2pyslices.com

2013-06-15 Thread Niphlod
almost forgot. Second step is actually to add a time verification to see if 
user opened the comment form at least 5 seconds before posting.

On Saturday, June 15, 2013 10:52:44 PM UTC+2, Niphlod wrote:
>
> rephrasing. honeypot field (i.e. hidden from users, needs to be empty, 
> usually filled by bots) is the "simplier implementation".
> If users programming bots wants to tackle your site, they find the 
> honeypot pretty easily and then code accordingly, so back to square 1.
>
> Second one is js execution. This is effectively mitigating a lot (>90%) of 
> attempts on the aforementioned site. 
> I don't know why you state that js verification can be passed by bots... 
> usually they don't want to waste cpu resources loading a full js 
> environment (spidermonkey, phantomjs) just to crack your site (that's the 
> other <10%)
>
>
> Next on the moderation: everything gets checked in as draft and then 
> moderators check those messages and "publish them". Anthony's solution is 
> the best "bang for the buck" one, but a management "console" has to be 
> programmed anyway, and every bot that gets in needs to be removed anyway 
> (as right now)
>
> Here we stop about "transparent to the users" solutions to the problem.
>
> Next step, we want to "annoy" users.then requiring filling a captcha, 
> replying to a question, require to register all make sense, but it kinda 
> shifts the problem. captcha are passed right now, a small database of 
> answers gets pounded easily if the bot's programmer is looking at your site 
> (or, with wolphram alpha, he wants to enjoy natural language programming).
>
> Another step, pass everything through predefined filters, as 
> stopforumspam. Surely won't get you killed, but can be heavy on a social 
> app (thinking about slices that runs on pythonanywhere, don't know how much 
> "juice" has got).
> Yet another step, pass everything to akismet (@alan beat me while I was 
> writing the post). Doesn't work always and can ban for false positives. 
> Sync use slows the comment form a lot, async one needs some machinery to 
> work (again, checking in everything as draft, then submitting to akismet 
> and pruning whatever returns "it's a spam 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] Re: [web2py-dev] Re: Spammers on web2pyslices.com

2013-06-15 Thread Niphlod
rephrasing. honeypot field (i.e. hidden from users, needs to be empty, 
usually filled by bots) is the "simplier implementation".
If users programming bots wants to tackle your site, they find the honeypot 
pretty easily and then code accordingly, so back to square 1.

Second one is js execution. This is effectively mitigating a lot (>90%) of 
attempts on the aforementioned site. 
I don't know why you state that js verification can be passed by bots... 
usually they don't want to waste cpu resources loading a full js 
environment (spidermonkey, phantomjs) just to crack your site (that's the 
other <10%)


Next on the moderation: everything gets checked in as draft and then 
moderators check those messages and "publish them". Anthony's solution is 
the best "bang for the buck" one, but a management "console" has to be 
programmed anyway, and every bot that gets in needs to be removed anyway 
(as right now)

Here we stop about "transparent to the users" solutions to the problem.

Next step, we want to "annoy" users.then requiring filling a captcha, 
replying to a question, require to register all make sense, but it kinda 
shifts the problem. captcha are passed right now, a small database of 
answers gets pounded easily if the bot's programmer is looking at your site 
(or, with wolphram alpha, he wants to enjoy natural language programming).

Another step, pass everything through predefined filters, as stopforumspam. 
Surely won't get you killed, but can be heavy on a social app (thinking 
about slices that runs on pythonanywhere, don't know how much "juice" has 
got).
Yet another step, pass everything to akismet (@alan beat me while I was 
writing the post). Doesn't work always and can ban for false positives. 
Sync use slows the comment form a lot, async one needs some machinery to 
work (again, checking in everything as draft, then submitting to akismet 
and pruning whatever returns "it's a spam 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] Many to many skills matrix

2013-06-15 Thread Angie Tawfik
Hi all,

 I have a group of employees and a set of skills. One employee can have 
many skills and one skill can be had by many employees. What I want to do 
is to represent the skills of all employees in one table, where the score 
of each employee in each skill is given on a scale from 0 to 5 like:


Name |  UNIX | Apache | Python |

AT  |  4  |3   |4   |

MO |  5  |3   |4   |

MF |  4  |3   |3   |



Model:
--

db.define_table('online_team',
Field('first_name', notnull=True),
Field('last_name', notnull=True),
Field('email', requires=IS_EMAIL(), notnull=True, unique=True),
Field('initials', notnull=True, unique=True))
##format='%(first_name, last_name)s')

db.define_table('skills',
Field('skill', notnull=True, unique=True))

db.define_table('ownership',
Field('initials', 'reference online_team'),
Field('skill', 'reference skills'))

Now, in my controller I have a function to add records to the ownership 
table (combining both skills and employees) and view these records on the 
fly (supposedly the table I drew above without the scores):

def view_matrix():
# create an insert form from the table
form = SQLFORM(db.ownership).process()

# if form correct perform the insert
if form.accepted:
response.flash = 'New skills added to team member. '

my_rows = 
SQLTABLE(db().select(db.ownership.ALL),headers='fieldname:capitalize')
return dict(form=form, rows=my_rows)

The problem is that whatever I insert into the form of ownership table, I 
get something like the attached screen, no real initials, no real skills 
despite skills table and employees table are there and filled with sample 
data. I have the feeling I am doing something wrong in the model / 
controller.

Your help is much appreciated. Thanks in advance.

All the best,
Angie Tawfik

-- 

--- 
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: Simple way to start a minimal web2py view and table border problem

2013-06-15 Thread LMisi
Thanks Anthony.
I see, i have to move closer friendship with css. You are right, i made a 
new app and edit the layout.html file. After some  attempt and experiment 
succeeded to produce a visible table border with a relatively clean view. 
Probebly i had/have a bad edited layout.html file, it made abnormal 
presence.

2013. június 14., péntek 17:37:35 UTC+2 időpontban Anthony a következőt 
írta:
>
> The default layout in the welcome app (which is used to generate new apps) 
> comes from /views/layout.html, and the default index page comes from 
> /views/default/index.html. If you do not like the defaults, simply delete 
> those files and build your layout and other views from scratch as per the 
> documentation: http://web2py.com/books/default/chapter/29/05#Page-layout.
>
> As for , are you using the scaffolding app with no CSS 
> modifications? If so, there should be a 1px border. Anyway, you might 
> consider using CSS to style your table rather than the "border" attribute.
>
> Anthony
>
> On Friday, June 14, 2013 11:14:52 AM UTC-4, LMisi wrote:
>>
>> When I'm create a new application, i get a complacated initial view. 
>> For example annoying "Welcome customize me" text. If you are not a 
>> html/css guru,
>> you have hard time while remove it, becouse the doc does not contains it. 
>> step by step.
>> I think the initial clearing would be the first thing in the 
>> documentation.
>> Ohh i forget, how i removed these items.
>> You get good links and logo and trademark and large unusable empty space 
>> left side, but it's unnecessary for a simple database user app. 
>> I haven't found simple solutions.
>>
>> Another problem is  not working.
>>
>> Please send me link, suggestions. 
>> I think the documentation mainly for webaware programmer, not for simple 
>> database programmer.
>>
>> I know the error in me and web2py is a great framework, i love it:). 
>>
>> I just have very simple html knowlage, the layout.html and web2py.css is 
>> very complacated for me.
>> The base doc is exhaustive, but i would like more 
>> information-documentations in step by step manner about how to change 
>> background, remove empty space from left..
>>
>> Thanks any answer.
>>
>>
>>
>>

-- 

--- 
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: [web2py-dev] Re: Spammers on web2pyslices.com

2013-06-15 Thread Alan Etkin
What about this. Would it be useful? Looks like the source is not mantained 
nowadays.

http://www.voidspace.org.uk/python/akismet_python.html

-- 

--- 
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: [web2py-dev] Re: Spammers on web2pyslices.com

2013-06-15 Thread villas
Why is honeypot field your first stop when I just said that it was too 
unreliable?  (Especially as my site was not even worth spamming).  

JS verification can be bypassed completely by bots,  so what do you have in 
mind?

My question/answer solution is better than a simple honeypot field,  so 
didn't you like that idea?


On Saturday, 15 June 2013 20:29:42 UTC+1, Niphlod wrote:
>
> honeypot is the first stop, javascript evaluation is the second 
> another step that is almost impossible to break is to require registration 
> for everything (on google and facebook), but that can scare off users 
> (although probably not users of web2pyslices.com)
>
> On Saturday, June 15, 2013 9:10:51 PM UTC+2, villas wrote:
>>
>> I started to get bot spam.  So I introduced the non-displayed honeypot 
>> field that the bots would complete.  This worked great at first,  but the 
>> bots seemed to learn the trick and started leaving it empty.  So the spam 
>> returned.  
>>
>> After a little research,  I decided that I liked those questions that 
>> humans can easily answer,  but bots cannot.  
>>
>> Only problem with the questions is that there can be several 'right' 
>> answers eg. zero, 0, none, nil, nothing -- might all be acceptable 
>> answers.  Also the questions needed to be selected at random.  So my 
>> solution needed to be not only simple but flexible too.  
>>
>> Anyhow I wrote that code and I have not been troubled by spam since.  If 
>> anyone is interested in this idea I will extract the code from my app and 
>> post it.
>>
>> Regards,  D
>>
>>  
>>
>>
>>

-- 

--- 
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: [web2py-dev] Re: Spammers on web2pyslices.com

2013-06-15 Thread Niphlod
honeypot is the first stop, javascript evaluation is the second another 
step that is almost impossible to break is to require registration for 
everything (on google and facebook), but that can scare off users (although 
probably not users of web2pyslices.com)

On Saturday, June 15, 2013 9:10:51 PM UTC+2, villas wrote:
>
> I started to get bot spam.  So I introduced the non-displayed honeypot 
> field that the bots would complete.  This worked great at first,  but the 
> bots seemed to learn the trick and started leaving it empty.  So the spam 
> returned.  
>
> After a little research,  I decided that I liked those questions that 
> humans can easily answer,  but bots cannot.  
>
> Only problem with the questions is that there can be several 'right' 
> answers eg. zero, 0, none, nil, nothing -- might all be acceptable 
> answers.  Also the questions needed to be selected at random.  So my 
> solution needed to be not only simple but flexible too.  
>
> Anyhow I wrote that code and I have not been troubled by spam since.  If 
> anyone is interested in this idea I will extract the code from my app and 
> post it.
>
> Regards,  D
>
>  
>
>
>

-- 

--- 
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: example for validating input (using requires = IS_IN_DB) against form.vars before submit.

2013-06-15 Thread Alan Etkin

>
> I am looking for an example for validating input (using requires = 
> IS_IN_DB) against form.vars before submit.
>

You mean you want to test an html form values to match a set of db values 
client-side?

-- 

--- 
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: [web2py-dev] Re: Spammers on web2pyslices.com

2013-06-15 Thread villas
I started to get bot spam.  So I introduced the non-displayed honeypot 
field that the bots would complete.  This worked great at first,  but the 
bots seemed to learn the trick and started leaving it empty.  So the spam 
returned.  

After a little research,  I decided that I liked those questions that 
humans can easily answer,  but bots cannot.  

Only problem with the questions is that there can be several 'right' 
answers eg. zero, 0, none, nil, nothing -- might all be acceptable 
answers.  Also the questions needed to be selected at random.  So my 
solution needed to be not only simple but flexible too.  

Anyhow I wrote that code and I have not been troubled by spam since.  If 
anyone is interested in this idea I will extract the code from my app and 
post it.

Regards,  D

 


-- 

--- 
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] example for validating input (using requires = IS_IN_DB) against form.vars before submit.

2013-06-15 Thread webpypy
Hi,

I am looking for an example for validating input (using requires = 
IS_IN_DB) against form.vars before submit.

Your help is appreciated.

Regards,

Ashraf

-- 

--- 
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: Referenced table values order

2013-06-15 Thread lesssugar
Missed "%":

'%(name)s'

It's kinda comforting that the Framefork Creator makes mistakes also ;))

Of course, thanks for help.


On Saturday, June 15, 2013 6:35:12 PM UTC+2, Massimo Di Pierro wrote:
>
> My bad. Try this
>
> db.seafarer_education.country.requires=IS_IN_DB(db,'country.id
> ','(name)s',orderby=db.country.name)
>
> On Saturday, 15 June 2013 11:07:01 UTC-5, lesssugar wrote:
>>
>> Almost. I get the following error when I get to appadmin:
>>
>> *__init__() got an unexpected keyword argument 'format'*
>> *
>> *
>> My test table:
>>
>> db.define_table('seafarer_education',
>> Field('user_id', db.auth_user, default=auth.user_id, readable=False, 
>> writable=False),
>> Field('school'),
>> Field('country', db.country),
>> Field('title'),
>> Field('major'),
>> Field('speciality'),
>> Field('year_from',  length = 4),
>> Field('year_to', length = 4),
>> format=lambda r: r.school
>> )
>>
>> db.seafarer_education.country.requires=IS_IN_DB(db,'country.id
>> ',format='%(name)s',orderby=db.country.name)
>>
>> Must add the table is created in a separate model (so not db.py). Not 
>> sure if it's an issue here.
>>
>>
>> On Saturday, June 15, 2013 5:30:51 PM UTC+2, Massimo Di Pierro wrote:
>>>
>>> This should do it.
>>>
>>> db.table.country.requires=IS_IN_DB(db,'country.id
>>> ',format='%(name)s',orderby=db.country.name)
>>>
>>>
>>> On Saturday, 15 June 2013 10:10:56 UTC-5, lesssugar wrote:

 I have a table 'country' storing country names. Its format is 

 format=lambda r: r.name

 I'm referencing the table in another one like this

 ...
 Field('country', db.country)
 ...

 When I create an update form for the second table, the Country field 
 comes as a drop-down and it's great. However, the country names are not 
 sorted. Is there a way to sort them on the level of defining tables or 
 format?



-- 

--- 
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: [web2py-dev] Re: Spammers on web2pyslices.com

2013-06-15 Thread Niphlod


On Saturday, June 15, 2013 6:17:37 PM UTC+2, Paolo valleri wrote:
>
> I don't see an approach able to tackle the issue at all,we should 
> implement several techniques together.
> Anyway, what shall we do when a bot is detected? Have we got a sort of 
> blacklist? If so,instead of starting with an empty list,  we could think to 
> start from a public available blacklist of bot.
>
ehm. when you detect a bot you don't allow it to post something ^_^. 
do you want to ban its ip ? sure, can be done, but it's quite a stretch. 
BTW, I created a stopforumspam plugin that validates to a list of ips 
and/or emails to sort out if you want to do that kind of check, but I think 
it's superflous if honeypots works out.

 

> Il giorno 15/giu/2013 15:51, "Niphlod" > 
> ha scritto:
>
>> I have an unrelated (on web2py's side) website that uses captchas from 
>> google and bots are successfully registering to it (of course, they need to 
>> be approved first but it's a PITA to remove them anyway).
>> There are captcha services that decode the images for you (and your bot).
>>
>> I'm working on a threaded comments plugin on my spare time and for spam 
>> prevention I just add some hidden fields that needs javascript to be 
>> filled. Given that bots running javascript code are a little percentage, 
>> this should mitigate the issue (at least, a similar technique on the 
>> aforementioned site is keeping spambots away).
>> Small problem, though, users with javascript disabled are left alone. If 
>> that is fine, I can share the draft code (was waiting to complete the 
>> plugin before posting to github and here, but if needed that's not a big 
>> deal)
>>
>> On Saturday, June 15, 2013 3:37:26 PM UTC+2, Alan Etkin wrote:
>>>
>>> Is it possible these are not being posted by bots? 
>>>
>>>
>>> It would take a very smart bot to pass captcha (no?). Maybe it is 
>>> possible to change type of captcha used (i.e. random visual tests like 
>>> those of arithmetics with objects, etc.)?. I'm clueless about 
>>> authentication beyond the built-in web2py features but I can help running 
>>> tests against the web2pyslices app if needed.
>>>
>>> If so, we might need another tactic, such as requiring that a new user's 
 first post be approved by a moderator.
>>>
>>>
>>> +1
>>>
>>  -- 
>>  
>> --- 
>> 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/M2HlsCpqHbM/unsubscribe.
>> To unsubscribe from this group and all its topics, 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.




[web2py] Re: Referenced table values order

2013-06-15 Thread Massimo Di Pierro
My bad. Try this

db.seafarer_education.country.requires=IS_IN_DB(db,'country.id
','(name)s',orderby=db.country.name)

On Saturday, 15 June 2013 11:07:01 UTC-5, lesssugar wrote:
>
> Almost. I get the following error when I get to appadmin:
>
> *__init__() got an unexpected keyword argument 'format'*
> *
> *
> My test table:
>
> db.define_table('seafarer_education',
> Field('user_id', db.auth_user, default=auth.user_id, readable=False, 
> writable=False),
> Field('school'),
> Field('country', db.country),
> Field('title'),
> Field('major'),
> Field('speciality'),
> Field('year_from',  length = 4),
> Field('year_to', length = 4),
> format=lambda r: r.school
> )
>
> db.seafarer_education.country.requires=IS_IN_DB(db,'country.id
> ',format='%(name)s',orderby=db.country.name)
>
> Must add the table is created in a separate model (so not db.py). Not sure 
> if it's an issue here.
>
>
> On Saturday, June 15, 2013 5:30:51 PM UTC+2, Massimo Di Pierro wrote:
>>
>> This should do it.
>>
>> db.table.country.requires=IS_IN_DB(db,'country.id
>> ',format='%(name)s',orderby=db.country.name)
>>
>>
>> On Saturday, 15 June 2013 10:10:56 UTC-5, lesssugar wrote:
>>>
>>> I have a table 'country' storing country names. Its format is 
>>>
>>> format=lambda r: r.name
>>>
>>> I'm referencing the table in another one like this
>>>
>>> ...
>>> Field('country', db.country)
>>> ...
>>>
>>> When I create an update form for the second table, the Country field 
>>> comes as a drop-down and it's great. However, the country names are not 
>>> sorted. Is there a way to sort them on the level of defining tables or 
>>> format?
>>>
>>>

-- 

--- 
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: [web2py-dev] Re: Spammers on web2pyslices.com

2013-06-15 Thread paolo.vall...@gmail.com
I don't see an approach able to tackle the issue at all,we should implement
several techniques together.
Anyway, what shall we do when a bot is detected? Have we got a sort of
blacklist? If so,instead of starting with an empty list,  we could think to
start from a public available blacklist of bot.
Il giorno 15/giu/2013 15:51, "Niphlod"  ha scritto:

> I have an unrelated (on web2py's side) website that uses captchas from
> google and bots are successfully registering to it (of course, they need to
> be approved first but it's a PITA to remove them anyway).
> There are captcha services that decode the images for you (and your bot).
>
> I'm working on a threaded comments plugin on my spare time and for spam
> prevention I just add some hidden fields that needs javascript to be
> filled. Given that bots running javascript code are a little percentage,
> this should mitigate the issue (at least, a similar technique on the
> aforementioned site is keeping spambots away).
> Small problem, though, users with javascript disabled are left alone. If
> that is fine, I can share the draft code (was waiting to complete the
> plugin before posting to github and here, but if needed that's not a big
> deal)
>
> On Saturday, June 15, 2013 3:37:26 PM UTC+2, Alan Etkin wrote:
>>
>> Is it possible these are not being posted by bots?
>>
>>
>> It would take a very smart bot to pass captcha (no?). Maybe it is
>> possible to change type of captcha used (i.e. random visual tests like
>> those of arithmetics with objects, etc.)?. I'm clueless about
>> authentication beyond the built-in web2py features but I can help running
>> tests against the web2pyslices app if needed.
>>
>> If so, we might need another tactic, such as requiring that a new user's
>>> first post be approved by a moderator.
>>
>>
>> +1
>>
>  --
>
> ---
> 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/M2HlsCpqHbM/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/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: Referenced table values order

2013-06-15 Thread lesssugar
Almost. I get the following error when I get to appadmin:

*__init__() got an unexpected keyword argument 'format'*
*
*
My test table:

db.define_table('seafarer_education',
Field('user_id', db.auth_user, default=auth.user_id, readable=False, 
writable=False),
Field('school'),
Field('country', db.country),
Field('title'),
Field('major'),
Field('speciality'),
Field('year_from',  length = 4),
Field('year_to', length = 4),
format=lambda r: r.school
)

db.seafarer_education.country.requires=IS_IN_DB(db,'country.id',format='%(name)s',orderby=db.country.name)




On Saturday, June 15, 2013 5:30:51 PM UTC+2, Massimo Di Pierro wrote:
>
> This should do it.
>
> db.table.country.requires=IS_IN_DB(db,'country.id
> ',format='%(name)s',orderby=db.country.name)
>
>
> On Saturday, 15 June 2013 10:10:56 UTC-5, lesssugar wrote:
>>
>> I have a table 'country' storing country names. Its format is 
>>
>> format=lambda r: r.name
>>
>> I'm referencing the table in another one like this
>>
>> ...
>> Field('country', db.country)
>> ...
>>
>> When I create an update form for the second table, the Country field 
>> comes as a drop-down and it's great. However, the country names are not 
>> sorted. Is there a way to sort them on the level of defining tables or 
>> format?
>>
>>

-- 

--- 
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: Filling form in multiple phases with some data from database and some from a dictionary

2013-06-15 Thread Ykä Marjanen
Hi J,

Of course you were here too :)

I solved the issue by using SQLFORM.factory to generate the form for those 
pages where there was a dictionary variable. I've edited the code so that I 
think I got it working properly.

I save the form.vars of each page to session.page_nro and at the end (four 
phases) I add them all to a one dictionary to add it to database: 
db.campaign.insert(**db_data).

It seems to work okay.

On Thursday, June 13, 2013 11:55:08 AM UTC+3, Ykä Marjanen wrote:
>
> Hi,
>
> I've been programming Python for 10 years now, mainly algorithms. I found 
> out about Web2py 4 months ago, and have been intensively learning it since. 
> So thanks for all contributors!
>
> I'm developing a web interface where a user can create a new idea 
> campaign. Because the campaign has lots of parameters which can change per 
> campaign, I've decided to store most of the settings to the database as a 
> dictionary using Pickle. I want to cut the creation of the campaign into 
> phases to keep the visible form short.
>
> Based on the documentation (excellent book) I've decided to use Session to 
> store the value from each phase and only store the variables into the 
> database after the user has filled all forms. I use the same page to show 
> different forms to keep the files to a minimum.
>
> My problems are the following:
>
> 1) How to use SQLFORM.dictform with a dictionary so that it shows menu 
> options (and checklist) to some of the settings (e.g. 
> IS_IN_SET(['one','two'])). The dictionary is created during the process, so 
> the database doesn't have no values in it to fetch.
>
> 2) Am I doing to this properly (see code below)?
>
> Here's my code (I've simplified it to make it more understandable)
>
> Model:
>
> db.define_table('campaign',
> Field('name', unique=True),
> Field('pagename', unique=True),
> Field('description','text'),
> Field('created_by','reference auth_user', default=auth.user_id),
> Field('type', requires=IS_IN_SET(['open','private'])),
> Field('general_settings','text', filter_in=(lambda x: 
> pickle.dumps(x)), filter_out=(lambda s: s and 
> pickle.loads(s)),default=None))
>
> Controller:
>
> if request.args(0,cast=str) == 'prev':
> try:
> if session.step > 0:
> session.step -= 1
> else:
> redirect(URL('index'))
> except:
> session.step = 0
>
> #determine in which step
> if not session.step:
> session.step = 0
>
> if session.step == 0:
> form = SQLFORM(db.campaign, fields=['name','description'])
> form.add_button('Cancel',URL('index'))
> if form.validate():
> session.step1_variables = form.vars
> session.step = 1
>
> redirect(URL('new_campaign'))
>
> elif session.step == 1:
> form = SQLFORM(db.campaign, fields=['pagename'])
> form.add_button('Prev',URL('new_campaign',args='prev'))
> if form.validate():
> session.step2_variables = form.vars
> session.step = 2
>
> redirect(URL('new_campaign'))
>
> elif session.step == 2:
> settings_dict = dict(privacy="", registration="self")
> form = SQLFORM.dictform(settings_dict)
> form.add_button('Prev',URL('new_campaign',args='prev'))
> form.custom.widget.privacy['requires'] = 
> IS_IN_SET(['open','closed'])
> if form.validate():
> session.step3_variables = form.vars
> session.step = 3
>
> redirect(URL('new_campaign'))
>
> elif session.step == 3:
> form = FORM.confirm('Are you sure?')
> if form.accepted:
> session.step = 0
> #Store all variables to the database
> #Redirect to the new campaign page  
>
> else:
> redirect(URL('index'))
>
> return dict(form=form, step=session.step)
>
> View:
>
> {extend 'layout.html'}}
> {{if step == 0:}}
> {{=T('Create new campaign')}}
> {{=T('Welcome to XXX. Create a campaign using this simple wizard')}}
> {{elif step == 1:}}
> {{=T('Create new campaign')}}
> {{=T('Please add your pagename')}}   
> {{elif step == 2:}}
> {{=T('Create new campaign')}}
> {{=T('Make some settings')}}
> {{elif step == 3:}}
> {{=T('Create new campaign')}}
> {{=T('Here are all your settings. Click the button the accept them')}}
> {{pass}}
> {{=form}}
>

-- 

--- 
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: Referenced table values order

2013-06-15 Thread Massimo Di Pierro
This should do it.

db.table.
country.requires=IS_IN_DB(db,'country.id',format='%(name)s',orderby=db.country.name)


On Saturday, 15 June 2013 10:10:56 UTC-5, lesssugar wrote:
>
> I have a table 'country' storing country names. Its format is 
>
> format=lambda r: r.name
>
> I'm referencing the table in another one like this
>
> ...
> Field('country', db.country)
> ...
>
> When I create an update form for the second table, the Country field comes 
> as a drop-down and it's great. However, the country names are not sorted. 
> Is there a way to sort them on the level of defining tables or format?
>
>

-- 

--- 
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] Referenced table values order

2013-06-15 Thread lesssugar
I have a table 'country' storing country names. Its format is 

format=lambda r: r.name

I'm referencing the table in another one like this

...
Field('country', db.country)
...

When I create an update form for the second table, the Country field comes 
as a drop-down and it's great. However, the country names are not sorted. 
Is there a way to sort them on the level of defining tables or format?

-- 

--- 
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] Respective update / create form in a modal box

2013-06-15 Thread lesssugar
I have a list of items. Each of them is editable, I can also add a new one. 
My goal is to provide update / create form in a modal box. The perfect 
solution would be to have the modal's template and dynamically load 
respective form into it.

Now, to make it clear: I do not want to have lots of hidden forms, each 
showing up onclick. I would prefer to actually load e.g. an update form for 
"item 5" when I click the edit link attached to "item 5".

What is the right way to do it? I guess I should start with passing a 
specific argument (like item ID) to a specific function, responsible for 
update / create -- but then what? How do I return the proper form to my 
modal box?

-- 

--- 
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: The connection to mongodb://localhost/test could not be made

2013-06-15 Thread Alan Etkin
I have submitted a patch for the debugging problem of mongodb connections 
(not for your actual issue)

http://code.google.com/p/web2py/issues/detail?id=1532

Anyway, with that change, you should be able to allowed the driver error 
traceback at the error ticket.

-- 

--- 
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] Thesaurus for Web2py?

2013-06-15 Thread Joe Magaro
Hi, Can someone recommend a thesaurus that works with Web2py?

-- 

--- 
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: Scheduler compatible with nginx/uwsgi?

2013-06-15 Thread Niphlod
scheduler and whatever you choose to run your "web part" are totally 
unrelated. It's meant to be as a separate process, and can totally run on 
its own. What you need to check is that the scheduler instance can connect 
to the database (if this was a result of permission problems on the file, 
the breakage should have happened before those logs, e.g. reading the 
source file of web2py.py).

On Saturday, June 15, 2013 4:20:14 AM UTC+2, Joe Barnhart wrote:
>
> I'm trying to set up a test server that's close to the production server 
> I'm going to have.  I have a VM with web2py and nginx/uwsgi installed on 
> Debian.  The database is Postgres which runs on the host of the VM and 
> talks thru a "host only" network adapter, also on Linux.
>
> It all seems to work -- web2py can see and use the Postgres database, I 
> can serve pages thru nginx and uwsgi.  But when I start the scheduler all 
> hell breaks loose.
>
>
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2013
> Version 2.5.1-stable+timestamp.2013.06.06.15.39.19
> Database drivers available: SQLite(sqlite3), MySQL(pymysql), PostgreSQL(
> pg8000), IMAP(imaplib)
> starting single-scheduler for "swim_smarter"...
> ERROR:web2py.scheduler.groomlake2#3208:error popping tasks
> ERROR:web2py.scheduler.groomlake2#3208:Error retrieving status
> ERROR:web2py.scheduler.groomlake2#3208:error popping tasks
> ERROR:web2py.scheduler.groomlake2#3208:error popping tasks
> ERROR:web2py.scheduler.groomlake2#3208:error popping tasks
> ERROR:web2py.scheduler.groomlake2#3208:error popping tasks
> ERROR:web2py.scheduler.groomlake2#3208:error popping tasks
> ERROR:web2py.scheduler.groomlake2#3208:Error retrieving status
> ERROR:web2py.scheduler.groomlake2#3208:error popping tasks
> ERROR:web2py.scheduler.groomlake2#3208:error popping tasks
> ERROR:web2py.scheduler.groomlake2#3208:error popping tasks
> ERROR:web2py.scheduler.groomlake2#3208:error popping tasks
>
>
> Maybe I'm starting the scheduler wrong.  I'm using sudo to start an 
> instance of web2py separate from uwsgi, but using www-data:www-data as the 
> user and group.  I only pass "-K" and the application name, once here but 
> I'd like to start 3 to 6 instances.  The console begins immediately pouring 
> out error messages from the schedulers, but I can see from the databse 
> tables on the host that no processes have been inserted as workers into the 
> table yet.
>
> What is the best way of using scheduler processes with nginx/uwsgi?  Can 
> it be started and stopped with the server?  I really depend on this 
> scheduler -- it's one of the best features of web2py -- so if I have to use 
> apache or something else in production I'll do that.
>
> -- Joe
>

-- 

--- 
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-dev] Re: Spammers on web2pyslices.com

2013-06-15 Thread Niphlod
I have an unrelated (on web2py's side) website that uses captchas from 
google and bots are successfully registering to it (of course, they need to 
be approved first but it's a PITA to remove them anyway).
There are captcha services that decode the images for you (and your bot).

I'm working on a threaded comments plugin on my spare time and for spam 
prevention I just add some hidden fields that needs javascript to be 
filled. Given that bots running javascript code are a little percentage, 
this should mitigate the issue (at least, a similar technique on the 
aforementioned site is keeping spambots away).
Small problem, though, users with javascript disabled are left alone. If 
that is fine, I can share the draft code (was waiting to complete the 
plugin before posting to github and here, but if needed that's not a big 
deal)

On Saturday, June 15, 2013 3:37:26 PM UTC+2, Alan Etkin wrote:
>
> Is it possible these are not being posted by bots? 
>
>
> It would take a very smart bot to pass captcha (no?). Maybe it is possible 
> to change type of captcha used (i.e. random visual tests like those of 
> arithmetics with objects, etc.)?. I'm clueless about authentication beyond 
> the built-in web2py features but I can help running tests against the 
> web2pyslices app if needed.
>
> If so, we might need another tactic, such as requiring that a new user's 
>> first post be approved by a moderator.
>
>
> +1
>

-- 

--- 
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-dev] Re: Spammers on web2pyslices.com

2013-06-15 Thread Alan Etkin

>
> Is it possible these are not being posted by bots? 


It would take a very smart bot to pass captcha (no?). Maybe it is possible 
to change type of captcha used (i.e. random visual tests like those of 
arithmetics with objects, etc.)?. I'm clueless about authentication beyond 
the built-in web2py features but I can help running tests against the 
web2pyslices app if needed.

If so, we might need another tactic, such as requiring that a new user's 
> first post be approved by a moderator.


+1

-- 

--- 
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: The connection to mongodb://localhost/test could not be made

2013-06-15 Thread Alan Etkin

>
> I haven't been with the website for a while, and I do not understand this 
> error.
>

The driver could not connect to the mongodb backend. For debugging the 
connection error, you can try commenting the code under the except clause 
in dal.py near line 5234 and adding the raise command, so you can check the 
actual error traceback. Perhaps you want to check that the db server is up 
and running and using the same connection parameters and authentication 
options.

Also consider opening an issue at the project page because the error 
handling needs to be fixed.

-- 

--- 
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-dev] Re: Spammers on web2pyslices.com

2013-06-15 Thread Anthony
Is it possible these are not being posted by bots? If so, we might need 
another tactic, such as requiring that a new user's first post be approved 
by a moderator.

Anthony

On Saturday, June 15, 2013 5:33:12 AM UTC-4, rochacbruno wrote:
>
> Implemented only for user registration, but spammers are registering, so I 
> guess they have captcha breaking system or there is a hole in the website 
> security?
>  (needs investigation)
>
> The captcha, honeypot, confirm by email or something would be really nice 
> if implemented in "create a slice" form.
>
> I hope to get some help on this.
>
> Thanks.
>
>
> On Sat, Jun 15, 2013 at 5:11 AM, Paolo valleri 
> 
> > wrote:
>
>> Personally I don't like captcha image, before delving into the 
>> implementation of whatever like that it is worth to try the honeypot 
>> mechanism namely a 'hidden field'. A field that if filled out allow you to 
>> distinguish between user and robots requests. The field it is hidden by css 
>> properties real users aren't able to fill it.
>> More here: http://en.wikipedia.org/wiki/Honeypot_%28computing%29  
>> Actually, I have never tested if that really works!
>> we could think about implementing it as an option for web2py, it would be 
>> very welcome.
>> Finally, it seems that web2pyslices.com registration has got a captcha, 
>> have you already implemented it?
>>
>> Paolo
>>
>>
>> On Saturday, June 15, 2013 6:40:50 AM UTC+2, rochacbruno wrote:
>>>
>>> Hi,
>>>
>>> recently we are having too many spams posted on web2pyslices.com
>>>
>>> I am deleting one by one, but started to be difficult to track this.
>>>
>>> We need to implement a captcha system or any other kind of spam blocking.
>>>
>>> is there any volunter? to do this for user registration form and also 
>>> for article post form?
>>>
>>> I am in a rush between work and medical treatments, I tried but I really 
>>> have no time now to develop this.
>>>
>>> If anybody can take this, please email me ans I give you access to the 
>>> development version of the code on pythonanywhere.
>>>
>>> Thanks.
>>>
>>> []'s
>>>
>>> ---
>>>
>>> Bruno Rocha
>>> http://github.com/rochacbruno
>>> http://rochacbruno.com.br
>>> http://terraqueos.org
>>>
>>  -- 
>> -- mail from:GoogleGroups "web2py-developers" mailing list
>> make speech: web2py-d...@googlegroups.com 
>> unsubscribe: web2py-develop...@googlegroups.com 
>> details : http://groups.google.com/group/web2py-developers
>> the project: http://code.google.com/p/web2py/
>> official : http://www.web2py.com/
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py-develop...@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] The connection to mongodb://localhost/test could not be made

2013-06-15 Thread Hugo Costa
Hey,

So I returned to the web2py and I found this error on my website.

I haven't been with the website for a while, and I do not understand this 
error.

My db.py:

## if SSL/HTTPS is properly configured and you want all HTTP requests to
## be redirected to HTTPS, uncomment the line below:
# request.requires_https()

if not request.env.web2py_runtime_gae:
## if NOT running on Google App Engine use SQLite or other DB
#db = DAL('sqlite://storage.sqlite', pool_size=1, 
check_reserved=['all'], migrate=False)
#db = ('mongodb://localhost/test')
db = DAL("mongodb://localhost/test",
check_reserved=["mongodb_nonreserved",],
adapter_args={"safe":False})
else:
## connect to Google BigTable (optional 'google:datastore://namespace')
db = DAL('google:datastore')
## store sessions and tickets there
session.connect(request, response, db=db)
## or store session in Memcache, Redis, etc.
## from gluon.contrib.memdb import MEMDB
## from google.appengine.api.memcache import Client
## session.connect(request, response, db = MEMDB(Client()))

## by default give a view/generic.extension to all actions from localhost
## none otherwise. a pattern can be 'controller/function.extension'
response.generic_patterns = ['*'] if request.is_local else []
## (optional) optimize handling of static files
# response.optimize_css = 'concat,minify,inline'
# response.optimize_js = 'concat,minify,inline'

What can I do?

Thanks,

Hugo

-- 

--- 
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: routes_app

2013-06-15 Thread Júlia Rizza
Thank you guys!

Em quinta-feira, 13 de junho de 2013 10h20min22s UTC-3, Loïc escreveu:
>
> In your web2py root folder, you have a base routes.py 
> for example in the base routes.py you define your two applications app1 
> and app2 : 
>
> # -*- coding: utf-8 -*-
> #app1
> routes_app = (
> (r'.*?:https?://www.app1.com:\w* /$anything', r'app1'),
> (r'.*?:https?://app1.com:\w* /$anything', r'app1')
> )
> #app2
> routes_app += (
> (r'.*?:https?://www.app2.net:\w* /$anything', r'app2'),
> (r'.*?:https?://app2.net:\w* /$anything', r'app2')
> )
>
>
> Then in your application folder (app1 & app2) you have an other routes.py 
> which will be used in place of base routes.py for this app. For example
> In app1 folder :
>
> # -*- coding: utf-8 -*-
> routes_in = (
>   (r'/', r'/app1/default/index'),
>   (r'/images', r'/app1/images/images_list'),
>   (r'/contact', r'/app1/default/contact_form'),
> )
>
> routes_out = [(x, y) for (y, x) in routes_in]
>
>
>
>
> Le jeudi 13 juin 2013 14:04:39 UTC+2, Júlia Rizza a écrit :
>>
>> I was reading about the specific routes of applications in the 
>> booksection
>>  Application-Specific URL rewrite, but didn't understand well how it 
>> works. Could someone explain for me how routes_app create a routes.py 
>> specific in each app and, if possible, give me an example?
>>
>

-- 

--- 
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-dev] Re: Spammers on web2pyslices.com

2013-06-15 Thread Bruno Rocha
Implemented only for user registration, but spammers are registering, so I
guess they have captcha breaking system or there is a hole in the website
security?
 (needs investigation)

The captcha, honeypot, confirm by email or something would be really nice
if implemented in "create a slice" form.

I hope to get some help on this.

Thanks.


On Sat, Jun 15, 2013 at 5:11 AM, Paolo valleri wrote:

> Personally I don't like captcha image, before delving into the
> implementation of whatever like that it is worth to try the honeypot
> mechanism namely a 'hidden field'. A field that if filled out allow you to
> distinguish between user and robots requests. The field it is hidden by css
> properties real users aren't able to fill it.
> More here: http://en.wikipedia.org/wiki/Honeypot_%28computing%29
> Actually, I have never tested if that really works!
> we could think about implementing it as an option for web2py, it would be
> very welcome.
> Finally, it seems that web2pyslices.com registration has got a captcha,
> have you already implemented it?
>
> Paolo
>
>
> On Saturday, June 15, 2013 6:40:50 AM UTC+2, rochacbruno wrote:
>>
>> Hi,
>>
>> recently we are having too many spams posted on web2pyslices.com
>>
>> I am deleting one by one, but started to be difficult to track this.
>>
>> We need to implement a captcha system or any other kind of spam blocking.
>>
>> is there any volunter? to do this for user registration form and also for
>> article post form?
>>
>> I am in a rush between work and medical treatments, I tried but I really
>> have no time now to develop this.
>>
>> If anybody can take this, please email me ans I give you access to the
>> development version of the code on pythonanywhere.
>>
>> Thanks.
>>
>> []'s
>>
>> ---
>>
>> Bruno Rocha
>> http://github.com/rochacbruno
>> http://rochacbruno.com.br
>> http://terraqueos.org
>>
>  --
> -- mail from:GoogleGroups "web2py-developers" mailing list
> make speech: web2py-develop...@googlegroups.com
> unsubscribe: web2py-developers+unsubscr...@googlegroups.com
> details : http://groups.google.com/group/web2py-developers
> the project: http://code.google.com/p/web2py/
> official : http://www.web2py.com/
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py-developers+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: Spammers on web2pyslices.com

2013-06-15 Thread Paolo valleri
Personally I don't like captcha image, before delving into the 
implementation of whatever like that it is worth to try the honeypot 
mechanism namely a 'hidden field'. A field that if filled out allow you to 
distinguish between user and robots requests. The field it is hidden by css 
properties real users aren't able to fill it.
More here: http://en.wikipedia.org/wiki/Honeypot_%28computing%29  Actually, 
I have never tested if that really works!
we could think about implementing it as an option for web2py, it would be 
very welcome.
Finally, it seems that web2pyslices.com registration has got a captcha, 
have you already implemented it?

Paolo

On Saturday, June 15, 2013 6:40:50 AM UTC+2, rochacbruno wrote:
>
> Hi,
>
> recently we are having too many spams posted on web2pyslices.com
>
> I am deleting one by one, but started to be difficult to track this.
>
> We need to implement a captcha system or any other kind of spam blocking.
>
> is there any volunter? to do this for user registration form and also for 
> article post form?
>
> I am in a rush between work and medical treatments, I tried but I really 
> have no time now to develop this.
>
> If anybody can take this, please email me ans I give you access to the 
> development version of the code on pythonanywhere.
>
> Thanks.
>
> []'s
>
> ---
>
> Bruno Rocha
> http://github.com/rochacbruno
> http://rochacbruno.com.br
> http://terraqueos.org
>

-- 

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