[web2py] Re: Is auth.settings.login_onfail a documented callback?

2016-05-23 Thread 黄祥
perhaps an example can speak thousand words : e.g. def login_onfail(form): email = request.vars.email row = db((db.auth_user.email == email ) ).select().first() if row is not None: db.auth_event.insert(time_stamp = request.now, client_ip = request.client, user_id = row.id, origin = '%s/%s' % (re

[web2py] Re: scheduler use python modules

2016-05-23 Thread Dave S
On Monday, May 23, 2016 at 5:05:59 PM UTC-7, 黄祥 wrote: > > Does it work to import locale in the module instead of in the view? >> > > import python module doesn't work in web2py modules, so it must redefine > again (e.g. locale, datetime) > Importing datetime in a module called by a scheduler t

[web2py] Re: Is auth.settings.login_onfail a documented callback?

2016-05-23 Thread Anthony
As you have observed, it is not documented. If you're asking whether it is supported, yes -- I think the lack of documentation is just an oversight. Anthony On Monday, May 23, 2016 at 7:40:58 PM UTC-4, Antonio Salazar wrote: > > > I'm implementing a failed login cooldown timer using: > auth.set

[web2py] Re: scheduler use python modules

2016-05-23 Thread 黄祥
> > Does it work to import locale in the module instead of in the view? > import python module doesn't work in web2py modules, so it must redefine again (e.g. locale, datetime) > > Modules do not get the complete global environment from the model or > controller that calls them > (per reques

[web2py] Is auth.settings.login_onfail a documented callback?

2016-05-23 Thread Antonio Salazar
I'm implementing a failed login cooldown timer usin: auth.settings.login_onfail = lambda: ... Searching here it seems as the recommended approach, but the callback is not mentioned in the manual. Is it a documented feature? P.S. The manual only mentions these login callbacks: auth.settings.lo

[web2py] Re: scheduler use python modules

2016-05-23 Thread Dave S
On Monday, May 23, 2016 at 3:01:14 PM UTC-7, 黄祥 wrote: > *my conclusion :* > - python locale module when used by scheduler must redefine it again in > views > Does it work to import locale in the module instead of in the view? Modules do not get the complete global environment from the model

[web2py] Re: scheduler use python modules

2016-05-23 Thread 黄祥
in web2py book, i think we can put template using response.render in any place in views. *ref:* http://web2py.com/books/default/chapter/29/08/emails-and-sms?search=response.render#Using-the-template-system-to-generate-messages *the evidence fact i got :* - mail() with response.render() that execu

[web2py] Re: routes.py problems

2016-05-23 Thread BlueShadow
It seems to work now my routes.py had no default application. I still need to figure out how to route the other sites but new day new luck. thanks Jim -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google

[web2py] Re: No module named appname.modules.funtions

2016-05-23 Thread Dave S
On Monday, May 23, 2016 at 9:14:57 AM UTC-7, BlueShadow wrote: > > there were a couple files assigned to root^^ chown to www-data and it > worked^^ > > Always good to hear about a simple fix! /dps > On Sunday, May 22, 2016 at 2:28:38 PM UTC+2, BlueShadow wrote: >> >> Hi, >> Something is very

[web2py] Re: scheduler use python modules

2016-05-23 Thread Dave S
On Saturday, May 21, 2016 at 12:08:14 PM UTC-7, Anthony wrote: > > Just to be clear, the traceback is from the view? > It looks like the error involves a* mail template* that happens to be in a subdirectory of application/views. I can't read the traceback elsethread, not knowing enough about

[web2py] Re: scheduler use python modules

2016-05-23 Thread Dave S
On Saturday, May 21, 2016 at 1:28:20 AM UTC-7, 黄祥 wrote: > > is scheduler can use python modules? > Certainly. In one of my scheduled tasks, I import os.path, datetime, sys, pysftp, and time. And this is done in a module. The "outer" procedure in the model imports datetime, the module, and c

[web2py] Re: COLLATE for sorting in SQLite (especially in SQLFORM.grid)

2016-05-23 Thread Mirek Zvolský
So what for problem I have had earlier? I don't know. I have tested today and it works. Made I some mistake? Or something has changed in newer Web2py versions? Great ! Great ! Proper sorting in SQLite smartgrid now works. I do this in model (to be sure it run always, which is most important if I

Re: [web2py] Re: routes.py problems

2016-05-23 Thread Jim S
Have you looked at /var/log/nginx/error.log? -Jim On Monday, May 23, 2016 at 11:54:31 AM UTC-5, BlueShadow wrote: > > Os: ubuntu 16.04. Webserver: Nginx url: www.movie-alarm.de > Am 23.05.2016 18:52 schrieb "Jim Steil" >: > >> What OS? >> >> On Mon, May 23, 2016 at 11:52 AM, Jim Steil > > wrote:

Re: [web2py] Re: routes.py problems

2016-05-23 Thread Kevin Bethke
Os: ubuntu 16.04. Webserver: Nginx url: www.movie-alarm.de Am 23.05.2016 18:52 schrieb "Jim Steil" : > What OS? > > On Mon, May 23, 2016 at 11:52 AM, Jim Steil wrote: > >> What webserver, and what URL are you accessing? >> >> On Mon, May 23, 2016 at 11:45 AM, Jim Steil wrote: >> >>> And, what is

Re: [web2py] Re: routes.py problems

2016-05-23 Thread Jim Steil
What OS? On Mon, May 23, 2016 at 11:52 AM, Jim Steil wrote: > What webserver, and what URL are you accessing? > > On Mon, May 23, 2016 at 11:45 AM, Jim Steil wrote: > >> And, what is the error? >> >> On Mon, May 23, 2016 at 11:33 AM, BlueShadow >> wrote: >> >>> #!/usr/bin/python >>> # -*- codi

Re: [web2py] Re: routes.py problems

2016-05-23 Thread Jim Steil
What webserver, and what URL are you accessing? On Mon, May 23, 2016 at 11:45 AM, Jim Steil wrote: > And, what is the error? > > On Mon, May 23, 2016 at 11:33 AM, BlueShadow > wrote: > >> #!/usr/bin/python >> # -*- coding: utf-8 -*- >> >> >> routers = dict( >> BASE = dict( >> domains =

Re: [web2py] Re: routes.py problems

2016-05-23 Thread Kevin Bethke
like I said an internal server error so I guess the error is before web2py? On Mon, May 23, 2016 at 6:45 PM, Jim Steil wrote: > And, what is the error? > > On Mon, May 23, 2016 at 11:33 AM, BlueShadow > wrote: > >> #!/usr/bin/python >> # -*- coding: utf-8 -*- >> >> >> routers = dict( >> BASE

Re: [web2py] Re: routes.py problems

2016-05-23 Thread Jim Steil
And, what is the error? On Mon, May 23, 2016 at 11:33 AM, BlueShadow wrote: > #!/usr/bin/python > # -*- coding: utf-8 -*- > > > routers = dict( > BASE = dict( > domains = { > 'domain.com' : 'App', > 'www.domain.com' : 'App', > '111.111.111.111/test' : 'test

[web2py] Re: routes.py problems

2016-05-23 Thread BlueShadow
#!/usr/bin/python # -*- coding: utf-8 -*- routers = dict( BASE = dict( domains = { 'domain.com' : 'App', 'www.domain.com' : 'App', '111.111.111.111/test' : 'test', } ), App = dict( root_static=['BingSiteAuth.xml','googlea0df30fe6baf4df4.html', '

[web2py] Re: routes.py problems

2016-05-23 Thread Jim S
Can you post the routes.py that is not working? -Jim On Monday, May 23, 2016 at 11:20:41 AM UTC-5, BlueShadow wrote: > > I reinstalled pretty much everything on my Server new OS newest web2py ... > and got my application back and running :-) but web2py uses still the > default routes.py. > whe

[web2py] routes.py problems

2016-05-23 Thread BlueShadow
I reinstalled pretty much everything on my Server new OS newest web2py ... and got my application back and running :-) but web2py uses still the default routes.py. when I copied my old routes.py to the web2py root I got an internal server error. I thought well lets use the example file copied it

[web2py] Re: No module named appname.modules.funtions

2016-05-23 Thread BlueShadow
there were a couple files assigned to root^^ chown to www-data and it worked^^ On Sunday, May 22, 2016 at 2:28:38 PM UTC+2, BlueShadow wrote: > > Hi, > Something is very wrong with my web2py. I finally got the newest verion > (2.14.6 nginx/1.4.6, Python 2.7.6 Ubuntu 16.04) on my production serv

[web2py] Re: Which free email service works fine with web2py?

2016-05-23 Thread Pierre
mailgun works fine. it's free under a certain quota https://www.mailgun.com/ -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message bec

Re: [web2py] Re: Handling (2006, 'MySQL server has gone away') from Scheduler, pythonanywhere

2016-05-23 Thread Ian Ryder
No worries! For our app, no - the main thing being the consoles disappearing every day or two...no good for running background services. We now have our own AWS servers, took a bit of effort but it's a thing of beauty once it's all in place :) Don't get me wrong, PythonAnywhere is fantastic - s

Re: [web2py] Re: Handling (2006, 'MySQL server has gone away') from Scheduler, pythonanywhere

2016-05-23 Thread Andre Kozaczka
Thanks for the quick response! You still using pythonanywhere? On Monday, May 23, 2016 at 10:12:49 AM UTC-4, Ian Ryder wrote: > Hi Andre, yes, I did indeed write my own - there's a lot in the built in > one we just didn't need and we really needed to be able to see everything > that was happen

Re: [web2py] Re: Handling (2006, 'MySQL server has gone away') from Scheduler, pythonanywhere

2016-05-23 Thread Ian Ryder
Hi Andre, yes, I did indeed write my own - there's a lot in the built in one we just didn't need and we really needed to be able to see everything that was happening. I don't see the issue too often now and we have processes that have run for a month without issue...from memory I think the main

Re: [web2py] Re: Handling (2006, 'MySQL server has gone away') from Scheduler, pythonanywhere

2016-05-23 Thread Andre Kozaczka
Hi Ian - I'm running into the same issue as you. Do you know the root cause of the error? Did you end up creating your own scheduling handler? -Andre On Thursday, February 5, 2015 at 5:55:04 AM UTC-5, Ian Ryder wrote: > Think it is pretty similar to this - we have 3 databases open. Seems to >

[web2py] Re: Which free email service works fine with web2py?

2016-05-23 Thread 黄祥
not sure what do you need, do you mean the smtp service? i think you could use your isp smtp or smtp from your domain hosting. i've seen in the other post that gmail is fine if you don't activate two factor authentification in gmail (lionel point it up, if i'm not mistake) best regards, stifan

[web2py] Re: Create SQLFORM having one submit button for 2 distinct tables

2016-05-23 Thread Mohit Jain
Thanks Anthony for your suggestion! Works just fine :) For anyone looking at a similar problem, here's what I've done now. form = SQLFORM.factory( Field('appStart','datetime',label='App-Period Start Time'), Field('appEnd','datetime',label='App-Period End Time')

[web2py] Which free email service works fine with web2py?

2016-05-23 Thread Steve Joe
I used to use gmail. Had a lot of struggle and one fine day it started working. Now again it doesn't work. I get no emails! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (R