[web2py] Re: scheduler task_id assigned to multiple workers

2016-08-16 Thread Dave S
On Tuesday, August 16, 2016 at 9:38:09 AM UTC-7, Jason Solack wrote: > > Hello all, i am having a situation where my scheduled jobs are being > picked up by multiple workers. My last task was picked up by all 12 > workers and is crushing the machines. This is a load balanced machine with >

[web2py] Re: scheduler task_id assigned to multiple workers

2016-08-16 Thread Jason Solack
task = scheduler.queue_task(tab_run, pvars=dict(tab_file_name=tab_file_name, the_form_file=the_form_file), timeout=60 * 60 * 24, sync_output=2, immediate=False, group_name=scheduler_group_name) anything look amiss here? On Tuesday, August 16, 2016 at 2:14:38 PM UTC-4, Dave S wrote: >

Re: [web2py] Re: Web2Py tool: Amazon SNS integration

2016-08-16 Thread Dave S
On Tuesday, August 16, 2016 at 6:17:11 AM UTC-7, Kiran Subbaraman wrote: > > I don't have code for this, but the general idea would be: > * Refer to the SNS API from here: > http://docs.aws.amazon.com/sns/latest/api/Welcome.html. I would use the > `requests` library to interact with the API.

Re: [web2py] Re: Deployment question

2016-08-16 Thread Jim Steil
Richard I have not had it successfully running under ubuntu 16.04 with a prior version of pandas. I have it running on Ubuntu 14.04 with the same version of pandas. It fails on: import pandas as pd -Jim On Tue, Aug 16, 2016 at 1:02 PM, Richard Vézina wrote: >

Re: [web2py] Re: Deployment question

2016-08-16 Thread Richard Vézina
Can you identify the responsible piece of pandas code that cause the issue? It don't make sens if you can't import pandas as pd in U16.04... I just try and it works... sudo pip show pandas --- Metadata-Version: 1.1 Name: pandas Version: 0.18.1 Summary: Powerful data structures for data analysis,

Re: [web2py] Re: Deployment question

2016-08-16 Thread Jim Steil
>From my system: administrator@ubuntu16-2:/etc/nginx/sites-enabled$ sudo pip show pandas [sudo] password for administrator: --- Metadata-Version: 2.0 Name: pandas Version: 0.18.1 Summary: Powerful data structures for data analysis, time series,and statistics Home-page: http://pandas.pydata.org

Re: [web2py] Re: Deployment question

2016-08-16 Thread Richard Vézina
Strange! Missing dependency which didn't install because of a broken link? Richard On Tue, Aug 16, 2016 at 3:22 PM, Jim Steil wrote: > From my system: > > administrator@ubuntu16-2:/etc/nginx/sites-enabled$ sudo pip show pandas > [sudo] password for administrator: > --- >

Re: [web2py] Re: Deployment question

2016-08-16 Thread Richard Vézina
Which version of web2py? I just try impor... with command line web2py instance and it works... I am using web2py 2.14.6 Richard On Tue, Aug 16, 2016 at 3:34 PM, Jim Steil wrote: > Let me restate my issue > > I can use pandas just fine on ubuntu 16.04. The problem occurs

Re: [web2py] Re: Deployment question

2016-08-16 Thread Jim S
In my reading I didn't see that downgrading pandas would help. Am I missing something or did I mislead you with my post? Downgrading ubuntu would help (which is what we have now, but would like to run the latest ubuntu). But, back to the main question, what are the biggest factors in not

Re: [web2py] Re: Deployment question

2016-08-16 Thread Richard Vézina
You may have a check, here some way of doing it : http://stackoverflow.com/questions/16294819/how-to-check-if-my-python-has-all-required-packages http://stackoverflow.com/questions/22213997/programmatically-check-if-python-dependencies-are-satisfied Would try with pip freeze first... Richard

Re: [web2py] Re: Web2py tool : Send emails to multiple user on schedule basis

2016-08-16 Thread Dave S
On Tuesday, August 16, 2016 at 4:58:11 AM UTC-7, madhu nomula wrote: > > Thank you. > I moved the code to Model. But could you please share me steps that > how to schedule(trigger) it send emails. > > I thought my suggested code was pretty clear. sched_tasks() sets up the task to run every

Re: [web2py] Re: Deployment question

2016-08-16 Thread Richard Vézina
Maybe try reinstall pip package, or if you use ubuntu package, use pip one instead... On Tue, Aug 16, 2016 at 3:16 PM, Richard Vézina wrote: > Can you identify the responsible piece of pandas code that cause the > issue? It don't make sens if you can't import

Re: [web2py] Re: Deployment question

2016-08-16 Thread Jim Steil
Let me restate my issue I can use pandas just fine on ubuntu 16.04. The problem occurs when I'm importing a module into a web2py controller and that module fails to import on the 'import pandas as pd' line. Just to be clear, pandas works find on the box. It is when it runs on web2py through

[web2py] Re: Referencing a table in web2py before defining it

2016-08-16 Thread Oasis Agano
*I did this * db = DAL(lazy_tables=True) db.define_table('employee', Field('fullname','string',label='Name'), Field('email','string'), Field('phone','string'), Field('kids', 'string'), Field('phone', 'string'),

[web2py] Re: Referencing a table in web2py before defining it

2016-08-16 Thread 黄祥
i think the error related with auth definition is not found, perhaps because you define the employee table first and then (or not) auth definition. pls try : db = DAL(lazy_tables=True) from gluon.tools import Auth, Service, PluginManager, prettydate auth = Auth(db, host_names =

[web2py] Re: Referencing a table in web2py before defining it

2016-08-16 Thread Oasis Agano
Is there any way of using 3-4 tables like emp,dept,emp_dept then dept_manager if yes can you show me how i can proceed Kind regards On Sunday, August 14, 2016 at 11:02:56 PM UTC+2, Oasis Agano wrote: > > My code is the following im trying to assign a department to employees and > also create a

Re: [web2py] Re: Web2Py tool: Amazon SNS integration

2016-08-16 Thread madhu nomula
Thank you. I am completely new to this area. Could you please share sample code with configure steps for SNS and integration in to Web2py tool. Yes, the changed/newly inserted/deleted data has to be pushed. Regards, MC. On Wed, Aug 3, 2016 at 10:44 AM, Kiran Subbaraman

Re: [web2py] Re: Web2py tool : Send emails to multiple user on schedule basis

2016-08-16 Thread madhu nomula
Thanks Dave. I wrote code like below: But I am not sure how to schedule this. Could you please guide me to configure this Scheduler (need bit more elaborated steps). Thank you appreciate your help: __ In Controller: SendEmail.py: # -*- coding: utf-8 -*- # try something like

Re: [web2py] Re: Web2py tool : Send emails to multiple user on schedule basis

2016-08-16 Thread 黄祥
i think the sendemail.py should be in models *models/SendEmail.py: * # -*- coding: utf-8 -*- # try something like from gluon.tools import Mail def send_email(): mail = Mail() #mail.settings.server = 'smtp.hitachiconsulting.com' mail.settings.server = 'smtp.gmail.com:587'

Re: [web2py] Re: Deployment question

2016-08-16 Thread Richard Vézina
Massimo's has always said it wasn't secure, I ignore the exact reason(s)... I suggest downgrading pandas with this rational you were using is in previous version of pandas and nginx without this problem... I do use pandas (but not HDF5 Store) and I don't experiment this issue... neither in 12.04

[web2py] Re: Deployment question

2016-08-16 Thread Dave S
On Tuesday, August 16, 2016 at 8:50:51 AM UTC-7, Jim S wrote: > > Hi > > I currently have my app deployed using Ubuntu 14.04 / nginx / uwsgi. I > have a couple of servers load-balanced behind a haproxy server. I'm > running ssl on the haproxy system and talking http to web2y through >

Re: [web2py] Re: Deployment question

2016-08-16 Thread Jim Steil
Importing pandas from the web2py shell works just fine. administrator@ubuntu16-2:/home/www-data/web2py$ sudo python web2py.py -a password -S connect web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2016 Version 2.14.6-stable+timestamp.2016.05.10.00.21.47 Database drivers

[web2py] Re: Referencing a table in web2py before defining it

2016-08-16 Thread Anthony
Below, you still have that extra db = DAL(...) line, which needs to be removed. On Tuesday, August 16, 2016 at 5:10:04 AM UTC-4, 黄祥 wrote: > > i think the error related with auth definition is not found, perhaps > because you define the employee table first and then (or not) auth >

[web2py] Re: Referencing a table in web2py before defining it

2016-08-16 Thread Oasis Agano
this solved it from datetime import datetime from gluon.tools import Auth db = DAL(lazy_tables=True) from gluon.tools import Auth, Service, PluginManager, prettydate auth = Auth(db, host_names = myconf.get('host.names') ) auth.define_tables(username = False, signature = True)

Re: [web2py] Re: Reopen a session without cookies

2016-08-16 Thread 黄祥
is it possible to send message to telegram bot from web2py? i've tried but no luck *error* 400 Bad Request -- nginx/1.6.2 *code* import requests def sendtelegram(): BOT = "@test_bot" text = "test" url = "https://telegram.me/%s/%%s; % BOT data =

Re: [web2py] Re: Customize multiselect widget

2016-08-16 Thread Clara Ferrando
Hello Donald, Thanks a lot for your detailed answer! I am going to try it; it seems to be exactly what I need and from your instructions, it should be simple to set up. I really appreciate your help! :-) Best regards, Clara On Tue, Aug 16, 2016 at 8:14 PM, Donald McClymont

[web2py] Web2py request different behavior on local and online version (server code executes, but returns 404

2016-08-16 Thread Ur. Kr.
On my local version of the application, making the request with the following code, executes the code on the server, returning successfully. $.ajax({ type: 'POST', url: "{{=URL('default', 'serverFunction.json')}}", data: {id: id}}); However, if I make the request like so (without '.json'

[web2py] Bug?: Spanish formatted dates won't store on database(english ones do)

2016-08-16 Thread Luciano Laporta Podazza
Hello, I'm working on a simple case file project and realized that working with english date format has no issues but if I use spanish ones(taking advantage of internacionalization) they don't get stored on database. Here is my controller: @auth.requires_login() def index(): """

[web2py] db.executesql() is taking 10 times longer than it should to run a query in Web2py

2016-08-16 Thread junderhill
Greetings. db.executesql() is taking 10 times longer than it should to run a query in Web2py, and I can’t figure out why. This is causing a huge bottleneck in my application. In the example below, the Web2py times are all over the map, ranging from 10ms to 500ms, whereas the query runs

[web2py] Making web2py AVailable in Softaculous

2016-08-16 Thread Brian Boatright
I've been using nosupportlinuxhosting for a while and with good success. At $1 per website per month it's a bargain for project sites and development. They use cPanel and one of the features of Cpanel is Softaculous to make setting up a LOT of popular web software and frameworks available

[web2py] Re: How to access class variable in web2py like we do in flask?

2016-08-16 Thread Massimo Di Pierro
can't you just use this? https://github.com/web2py/web2py/blob/master/gluon/contrib/websocket_messaging.py It does the same thing and ships with web2py. On Tuesday, 9 August 2016 16:02:58 UTC-5, Ron Chatterjee wrote: > > I tried to define those classes in db.py to make them global and >

[web2py] Re: Customize multiselect widget

2016-08-16 Thread Donald McClymont
I have got something like this working - basically based on the hradio widget which was developed by s-cubism so I define a widget in a module along the following lines: def hcheckbutton_widget(field, value, **attributes): rows = SQLFORM.widgets.checkboxes.widget(field,

[web2py] Re: Setting process title at web2py startup

2016-08-16 Thread Massimo Di Pierro
Not clear what you mean by what web2py starts. depending on the web server there may be more than one process and the web server manages those. My guess is that you want it done at the level of the web2py server rocket. In which case I would copy web2py.py into main.py and edit the latter. On

[web2py] Web2Py Navigating table records one at a time

2016-08-16 Thread Meinolf
Hi I am new to python and web2py. I have a small sqlite table of "career test" questions that i need to be presented to a user in form of a quiz, one question appearing at a time Problems: 1. I can't figure out how to safely stop at the last record, it breaks and after 3 more clicks, it takes

[web2py] New to web2py. Template use cases

2016-08-16 Thread billyhun01
Coming trying out different framework and really love web2py. The template language is very simple. how do I use it in different framework? Trying to replace jinja2 template with web2py template. import template seem to doesn't work with default jinja2 template language the framework assumes.

[web2py] reddit clone application name 'category' is not defined

2016-08-16 Thread Annexx Xaar
Hello sir i have tried all i could, still having errors in the reddit clone application. everything works fine except when i implemented {{=author(user_id)}} under list_posts_by_votes.html the errors blows when i click on the author of a comment. it does not dislay the author's name as it

Re: [web2py] Re: web3py status

2016-08-16 Thread fabio . filhossi
Neither do I. I really like this name !! So, Massimo, has this project been developing yet? On Monday, January 19, 2015 at 9:45:34 PM UTC-2, JorgeH wrote: > > I don't have any problem with the name whatsoever. I like it. > > On Monday, January 19, 2015 at 5:54:58 PM UTC-5, Massimo Di Pierro

[web2py] Strange error with cookies (to the same domain) accesed through the same router

2016-08-16 Thread Lisandro
I'm having this strange problem, and I would like to know if it is a web2py bug or is something that I'm missing. My web2py app is accesed through a domain, and in the model file, I connect to the db and to the session like this: db = DAL('postgres:.', migrate=False, lazy_tables=True)

[web2py] Re: How to access class variable in web2py like we do in flask?

2016-08-16 Thread Ron Chatterjee
Yes Massimo, I am working on it. I want to put a wrapper for webrtc on the top and use this to create the channel. On Tuesday, August 16, 2016 at 7:56:59 PM UTC-4, Massimo Di Pierro wrote: > > can't you just use this? >

[web2py] Re: Web2py and XMPP

2016-08-16 Thread 黄祥
is there any way to send chat message to xmpp from web2py? i've tried before but no luck. e.g. *controllers/default.py* def sendjabber(): import xmpp FROM_JABBER_ID = "from...@fujabber.com" JABBER_PASS = "from_id_pass" #JABBER_PORT = "80" #JABBER_PORT = "443" #JABBER_PORT = "5222" #JABBER_PORT =

[web2py] Re: Strange error with cookies (to the same domain) accesed through the same router

2016-08-16 Thread Anthony
I'm not sure what the actual problem is, but what leads you to believe it has anything to do with cookies? On Tuesday, August 16, 2016 at 7:08:00 PM UTC-4, Lisandro wrote: > > I'm having this strange problem, and I would like to know if it is a > web2py bug or is something that I'm missing. > >

[web2py] Re: web2py admin - cannot install plugin - bug??

2016-08-16 Thread Mirek Zvolský
So, I have fixed few bugs in admin/default/design and have created a pull request, and finally I know the real error. It has nothing with Web2py, but with tarfile.py. No idea why but one file inside plugin archive has date 01.01.1970 and this made problems for tarfile.py, as mentioned here:

Re: [web2py] Re: Web2Py tool: Amazon SNS integration

2016-08-16 Thread Kiran Subbaraman
I don't have code for this, but the general idea would be: * Refer to the SNS API from here: http://docs.aws.amazon.com/sns/latest/api/Welcome.html. I would use the `requests` library to interact with the API. Or you could search for a python client for this API. * Scheduler implementation,

Re: [web2py] Re: Web2py tool : Send emails to multiple user on schedule basis

2016-08-16 Thread madhu nomula
Thank you. I moved the code to Model. But could you please share me steps that how to schedule(trigger) it send emails. On Tue, Aug 16, 2016 at 5:19 PM, 黄祥 wrote: > i think the sendemail.py should be in models > models/SendEmail.py: > # -*- coding: utf-8 -*- > # try

[web2py] Deployment question

2016-08-16 Thread Jim S
Hi I currently have my app deployed using Ubuntu 14.04 / nginx / uwsgi. I have a couple of servers load-balanced behind a haproxy server. I'm running ssl on the haproxy system and talking http to web2y through nginx/uwsgi. Now, I'm trying to upgrade ubuntu to 16.04 and an having issues

[web2py] Re: Deployment question

2016-08-16 Thread Ron Chatterjee
On that note, can someone point me to documentation about how to set up an environment in dedicated sever on X86? I am thinking about co-locating than shared hosting. If someone does go that route, how we manage to set up the hosting environment? On Tuesday, August 16, 2016 at 11:50:51 AM

[web2py] Re: Deployment question

2016-08-16 Thread Jim S
Ron It would depend on what OS you're running on the x86 box. This would be a good place to start http://web2py.com/books/default/chapter/29/13/deployment-recipes Also, if you don't mind, could you re-post this in a new thread so this thread could focus on my initial question? -Jim On

[web2py] scheduler task_id assigned to multiple workers

2016-08-16 Thread Jason Solack
Hello all, i am having a situation where my scheduled jobs are being picked up by multiple workers. My last task was picked up by all 12 workers and is crushing the machines. This is a load balanced machine with 3 machine and 4 workers on each machine. has anyone experienced something like

Re: [web2py] Re: Deployment question

2016-08-16 Thread Richard Vézina
You can't downgrade pandas package? Richard On Tue, Aug 16, 2016 at 12:35 PM, Jim S wrote: > Ron > > It would depend on what OS you're running on the x86 box. This would be a > good place to start http://web2py.com/books/default/chapter/29/13/ > deployment-recipes > > Also, if