[web2py] Sharing a database between apps

2011-10-07 Thread Harshad
I was wondering if its possible to share a database between apps. I have two apps. One is a background process that discovers devices on the network using bonjour and adds them to the database. The other app provides a web interface to view these discovered devices. How do I share the same databas

[web2py] Re: Sharing a database between apps

2011-10-07 Thread Harshad
efault/chapter/04#Cooperation > > On Oct 7, 11:11 am, Harshad wrote: > > > > > > > > > I was wondering if its possible to share a database between apps. I > > have two apps. One is a background process that discovers devices on > > the network using bonjo

[web2py] JSONP in web2py

2011-10-12 Thread Harshad
I know this has been discussed earlier, but I am not sure how to use JSONP for cross domain communication correctly. This is how I make the request: var jqxhr = $.getJSON('get_devices.jsonp', function(data) { displayList(data); }) .error(function() { alert("

[web2py] Design Issue

2011-10-14 Thread Harshad
I am trying to create a web app that allows you to control various devices simultaneously. The simplified design is as follows: - One main background process continuously polls a database table for any device control requests - Once it sees a request, it spawns two threads: send and

[web2py] Threads operating on database causing a crash

2011-10-16 Thread Harshad
class Worker(threading.Thread): def run(self): print self.name, "running..." while True: if db(db.temperature).isempty(): print "empty" else: print "not empty" time.sleep(1) Running the above code causes the ap

[web2py] Re: Threads operating on database causing a crash

2011-10-16 Thread Harshad
The design is discussed here: https://groups.google.com/forum/#!topic/web2py/R8N2CRP-ifY I was hoping to get some feedback on that but never got any :(

[web2py] Re: Threads operating on database causing a crash

2011-10-17 Thread Harshad
Seriously, no one?

[web2py] Re: Design Issue

2011-10-17 Thread Harshad
Oh, I see your point. Letting the main thread do all the db interaction makes perfect sense. Also, I'll use the queue model for interaction between the main thread and the send/receive threads. Thanks Massimo - you're a good man.

[web2py] Re: Threads operating on database causing a crash

2011-10-17 Thread Harshad
*Update:* Issue has been addressed in the following thread https://groups.google.com/forum/#!topic/web2py/R8N2CRP-ifY

[web2py] AJAX weirdness

2011-10-18 Thread Harshad
Following is the code that makes the ajax call: $.ajax({ type: "GET", url: '/devicemanager/default/get_response.json/192.168.1.24/107', success: display_received, }); display_received displays the received information. The controller simply does the following: de

[web2py] Re: AJAX weirdness

2011-10-18 Thread Harshad
$.ajax({ type: "GET", url: 'http://Harshad-PC.local/devicemanager/default/get_response.json/192.168.1.24/107', success: function(data,textStatus,jqXHR) {alert("Success! Data: "+data)}, error: function(data,textStatus,jqXHR) {aler

[web2py] Re: AJAX weirdness

2011-10-18 Thread Harshad
Wouldn't this only be a problem if I was actually making a cross-domain call? The remote machines are on the same local area network as the server.

Re: [web2py] AJAX weirdness

2011-10-18 Thread Harshad
I'm at home right now, but I'll try that at work tomorrow. Thanks.

Re: [web2py] AJAX weirdness

2011-10-19 Thread Harshad
Thanks to rochacbruno and Anthony, I was able to solve this problem. All I did was include the line response.generic_patters=[*] in db.py.

Re: [web2py] AJAX weirdness

2011-10-19 Thread Harshad
Before we close this thead, I am curious as to why/how is this a security risk?

Re: [web2py] AJAX weirdness

2011-10-19 Thread Harshad
Makes sense. Thanks.

[web2py] Hardware Requirements for Deployment

2011-11-02 Thread Harshad
I've been asked by my colleagues to enumerate all hardware requirements for deploying a server running web2py. My question is, how do I even begin to calculate the requirements for the architecture, storage space, memory, etc.? For architecture, am I basically stuck with x86? For storage, is the

[web2py] Cannot access db in a thread

2016-12-02 Thread Harshad
I have a separate process that I run along with my web application by creating a subprocess like so: subprocess.Popen("python web2py.py -v -e -a admin -i 0.0.0.0 -p 8080 -c -k ".split()) subprocess.Popen("python web2py.py -S -M -R ".split()) In that process, I start a thread to do