[web2py] Re: creating records in web2py after migration to postgresql
Yes, the question is I have no log or error to debug for the issue: After migration to postregsql and removing the errors, the insert record does not work. It returns no error. The record does not get created. On Thursday, April 1, 2021 at 4:52:08 PM UTC-4 jonatha...@whatho.net wrote: > Do you have a question, because I an struggling to understand what it is? > > On Thursday, 1 April 2021 at 14:04:20 UTC+1 Aydin wrote: > >> I can create records in the interface of the postgresql and they show up >> in the web2py database admin. But the user I created in postgresql cannot >> login to the app. There is no error. >> Using SQLite, I could create records by web2py's database admin. is it >> still possible to create records if you use postgresql or not? Because as I >> said in the frist post, they do not get created. >> >> On Thursday, April 1, 2021 at 8:42:25 AM UTC-4 Aydin wrote: >> >>> I have moved my database from SQlite to postgresql. The problem I have >>> is that when I try to create any table, it does not return any notice and >>> refreshes the page and does not create the record. I have some tables and >>> none of them create a record. I am creating the records using admin page on >>> the website just like I did with SQLite. I read it is the same way with >>> postgresql. >>> >> -- 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 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. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/4c7c5b5b-0f07-478b-b869-101138bcda75n%40googlegroups.com.
[web2py] Re: creating records in web2py after migration to postgresql
I can create records in the interface of the postgresql and they show up in the web2py database admin. But the user I created in postgresql cannot login to the app. There is no error. Using SQLite, I could create records by web2py's database admin. is it still possible to create records if you use postgresql or not? Because as I said in the frist post, they do not get created. On Thursday, April 1, 2021 at 8:42:25 AM UTC-4 Aydin wrote: > I have moved my database from SQlite to postgresql. The problem I have is > that when I try to create any table, it does not return any notice and > refreshes the page and does not create the record. I have some tables and > none of them create a record. I am creating the records using admin page on > the website just like I did with SQLite. I read it is the same way with > postgresql. > -- 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 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. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/fe9299ff-cc66-4ecb-9740-a37aae77ad26n%40googlegroups.com.
[web2py] creating records in web2py after migration to postgresql
I have moved my database from SQlite to postgresql. The problem I have is that when I try to create any table, it does not return any notice and refreshes the page and does not create the record. I have some tables and none of them create a record. I am creating the records using admin page on the website just like I did with SQLite. I read it is the same way with postgresql. -- 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 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. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/c847a7aa-64f1-4ca6-b8fb-a479a17be834n%40googlegroups.com.
[web2py] Varying membership
I have a bunch of accounts in web2py and I want to create for each a group that additional users could access those accounts. For example, account 1 has a group id 1 and now I want to add additional users to this group. The problem I have is how can I use this group id to authorize. Meaning that when I use @auth.requires_membership(group_id = i) for the same function, i is something that varies. Maybe there is a much better way you can suggest for this need? -- 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 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. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/fe549c19-7c01-4999-a7c4-b560fa6a4d46%40googlegroups.com.
[web2py] User registration additional conditions
I have added an extra field in the auth_user and I want to check user's entry with a pre-poulated field (call field1) in another table (call Table1) when the user presses sign up. If a user's entry existed then set the registration_key to " " from "Pending". I formed the following from what I found which is not working: I added this in the user() function in defaults: if request.args(0) == 'register' and request.vars._next == 1: if db.auth.settings.additionalfield == "123": db.auth.settings.registration_key=''" -- 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 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. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/cae40e76-e829-4786-a8c2-3f30aec6ca66%40googlegroups.com.
[web2py] Re: Web2py registration of a second user verified by the first user
Thanks for the reply. I will update this on the path I chose. On Thursday, January 16, 2020 at 5:05:32 PM UTC-5, Dave S wrote: > > > > On Thursday, January 16, 2020 at 5:49:47 AM UTC-8, Aydin wrote: >> >> In my web2py app, I want to allow members that have the same key access >> the same information. The first user uses a key to register (key added to >> the Auth_user) and no verification is needed. Now, when the second user >> wants to sign up and uses the same key, I want an email to be sent to the >> first user and the first user verifies this registration. What's the >> easiest way to do this? By the way, I still use the email approval link for >> both first and second users to verify their emails. >> > > I would look at using groups for that. The first user would create the > group (as a side effect of registering the key), and you'd set the First > User to be able approve additions to the group. > > See auth.add_group() and auth.add_permission() in > http://www.web2py.com/books/default/chapter/29/09/access-control#Authorization > > > in the section before "Decorators". > > /dps > > -- 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 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. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/7e2c4bd6-7683-4534-9153-f38a125f6a30%40googlegroups.com.
[web2py] Web2py client device information
Is there a way to get the client device information such as the device and OS used? I know that we can get the public IP but for device and OS type could not find any reference. -- 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 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. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/85edb748-48f5-4a00-bd91-c82c56ce7c5d%40googlegroups.com.
[web2py] Web2py registration of a second user verified by the first user
In my web2py app, I want to allow members that have the same key access the same information. The first user uses a key to register (key added to the Auth_user) and no verification is needed. Now, when the second user wants to sign up and uses the same key, I want an email to be sent to the first user and the first user verifies this registration. What's the easiest way to do this? By the way, I still use the email approval link for both first and second users to verify their 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 (Report Issues) --- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/910a3de3-b40d-41b0-9356-4e0cba1bd78c%40googlegroups.com.
[web2py] Re: Pass variable from JavaScript function to controller: Using JSQueryBuilder
Anthony, how to pass multiple variables, say result1 and result2? On Thursday, September 22, 2016 at 2:18:01 PM UTC-4, Anthony wrote: > > "result" is a Javascript variable, so it does not exist in the Python > context in which the URL() function is evaluated. Instead, you must add > that part of the URL via Javascript: > > ajax('{{=URL('default', 'showfilters')}}' + '?result=' + result, [], > ':eval'); > > Anthony > > On Thursday, September 22, 2016 at 8:49:47 AM UTC-4, Madhavi wrote: >> >> Hi, >> >> >> >> I am trying to use JavaScript Query Builder plugin (querybuilder.js.org) >> with web2py. The plugin is installed successfully and I can see the >> querybuilder object in my view. I want to finally pass the string >> containing the filters selected from the view to another controller >> function for further processing. The code I am using on the view is below: >> >> >> >> Get rules >> >> >> >> function myFunction();{ >> >> var result = >> JSON.stringify($('#builder-basic').queryBuilder('getRules'), null, 2); >> >> ajax('{{=URL('default', 'showfilters', >> vars=dict(result=result))}}', [], ':eval'); >> >> } >> >> >> >> >> >> I want to pass ‘result’ variable to ‘showfilters’ controller function and >> call ‘showfilters’ view on clicking on ‘Get rules’ button. But the above >> code doesn’t work and gives this error: >> >> * name 'result' is not defined* >> >> I understand this could be because 'result' variable is not defined in my >> controller function corresponding to this view. What is the correct way to >> pass the value of a variable declared through Java Script to a controller >> function in web2py? >> >> Please help me here – I am novice to both web2py and Java Script and have >> been struggling with this for quite some time. I would prefer to pass the >> variable result through dictionary and not as an argument, as it will >> contain spaces and special characters which I want to preserve in the >> string. >> >> Thanks, >> >> Madhavi >> > -- 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 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. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/f069e3b8-a9a9-4018-96a3-f5a3e5e54b3a%40googlegroups.com.
[web2py] web2py webfaction unable to upload
I tried all those tricks here and in other forums to resolve this, shutdown the web2py and restarted it. no luck in fixing this. Any idea? Any one recently has dealt with this? Any help is appreciated. -- 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 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/d/optout.
[web2py] Web2py server crash, C extensions? lib directory
I just experienced server crash that was running web2py. These are the logs: [] [wsgi:error] Timeout when reading response headers from daemon process 'test': test/web2py/wsgihandler.py [] [wsgi:error] Timeout when reading response headers from daemon process 'test': test/web2py/wsgihandler.py [] [wsgi:error] Timeout when reading response headers from daemon process 'test':test/web2py/wsgihandler.py [] [core:warn] AH00045: child process 46211 still did not exit, sending a SIGTERM [] [core:warn] AH00045: child process 46211 still did not exit, sending a SIGTERM [] [core:warn] AH00045: child process 46211 still did not exit, sending a SIGTERM [] [core:error] AH00046: child process 46211 still did not exit, sending a SIGKILL [] [mpm_worker:notice] AH00298: SIGHUP received. Attempting to restart httpd.worker: Syntax error on line 10 of test/apache2/conf/httpd.conf: Cannot load modules/mod_wsgi.so into server: /lib64/libm.so.6: symbol __strtold_nan, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference Could this be related to any C extension modules that web2py may be using? something related to this: https://serverfault.com/questions/514242/non-responsive-apache-mod-wsgi-after-installing-scipy/514251#514251 Also, I just noticed that in the parent directory there is a lib folder that has a python2.7 folder in it which is empty. Is this supposed to be? The app works for a long time (12-24 hours) without any issue, but then it crashes, there are json calls to the app and the controller is as optimized as possible. Any idea what's going on? P.S. Merry Christmas! -- 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 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/d/optout.
[web2py] Web2py appliance TinyWebsite not working with Web2py 2.15.3
TinyWebsite appliance which was a good example is not working with Web2py 2.15.3. https://github.com/espern/tiny_website -- 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 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/d/optout.
[web2py] Re: Simple scheduler issue
I cann't believe I have spent 3 days trying every thing to find out what the hell is happening. Last time I used it, it was 2 years ago and I guess it was more intuitive to feel like python web2py.py -a pass -K myapp will run both the server and scheduler!!! Sorry everyone for the confusion. On Monday, January 2, 2017 at 6:04:57 PM UTC-5, Niphlod wrote: > > if you run a single process with > > python web2py.py -K appname > > ONLY the scheduler will be alive > > the web-serving part needs to be started as usual, in addition to the > previous process which just spins the scheduler process. > > On Monday, January 2, 2017 at 8:28:37 PM UTC+1, Aydin wrote: >> >> I had perfectly fine working app using scheduler in 2015, I tried to use >> that one but when trying to run the schedule (-K my app), the app does not >> run and web2py gets stuck in "starting single-scheduler...". This says to >> me something in terms of python and python tools version does not work well >> with web2py. I don't think there is anything wrong with the code I am using. >> >> On Monday, January 2, 2017 at 1:58:25 PM UTC-5, Aydin wrote: >>> >>> Sure, here are the databases I have tried to create: >>> >>> # db2 = DAL('sqlite://scheduler_storage.sqlite') >>> # db2 = DAL('pymysql://root:pass@localhost/testdb2') >>> db2=DAL('mysql://root:pass@localhost/testdb2') >>> >>> # db2 = DAL('MySQLdb://root:pass@localhost/testdb2') >>> # db2 = DAL('pymysql://root:pass@localhost/testdb1') >>> >>> for MySQLdb and pymysql I get the error that they are not supported. >>> mysql does not give that error but gets stuck in starting the task. >>> I even tried to import pymysql in web2py.py which did not help with the >>> error of it being not supported. >>> >>> On Monday, January 2, 2017 at 1:38:42 PM UTC-5, Dave S wrote: >>>> >>>> >>>> >>>> On Monday, January 2, 2017 at 8:22:55 AM UTC-8, Aydin wrote: >>>>> >>>>> I used the exact example shown by massimo (https://vimeo.com/27478796) >>>>> and it gets stuck at (starting single-scheduler for myapp...) and the >>>>> website does not come up saying browser cannot establish a connection). >>>>> Running on ubuntu and debian. >>>>> >>>> >>>> Can you show us your connection string (passwords obfuscated)? >>>> >>>> /dps >>>> >>>> >>>>> >>>>> On Monday, January 2, 2017 at 11:04:44 AM UTC-5, Niphlod wrote: >>>>>> >>>>>> scheduler definitely works for mysql. >>>>>> what you experienced is perfectly fine. a scheduler process just sits >>>>>> there if there is nothing to do (i.e. no tasks to process). >>>>>> >>>>>> On Sunday, January 1, 2017 at 5:14:21 PM UTC+1, Aydin wrote: >>>>>>> >>>>>>> I have used the scheduler before without being worried about the >>>>>>> database type. >>>>>>> I tried to use mysql but it gave an error that it is not supported. >>>>>>> I have mysql and pymysql installed and created a database "testdb" and >>>>>>> used >>>>>>> the manual format and got that error that it is not supported. >>>>>>> >>>>>>> On Saturday, December 31, 2016 at 4:09:23 PM UTC-5, 黄祥 wrote: >>>>>>>> >>>>>>>> perhaps, it related with database issue such as : sqlite >>>>>>>> had you already tried another database like mysql or postgresql? >>>>>>>> >>>>>>>> best regards, >>>>>>>> stifan >>>>>>>> >>>>>>> -- 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 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/d/optout.
[web2py] Re: Simple scheduler issue
I had perfectly fine working app using scheduler in 2015, I tried to use that one but when trying to run the schedule (-K my app), the app does not run and web2py gets stuck in "starting single-scheduler...". This says to me something in terms of python and python tools version does not work well with web2py. I don't think there is anything wrong with the code I am using. On Monday, January 2, 2017 at 1:58:25 PM UTC-5, Aydin wrote: > > Sure, here are the databases I have tried to create: > > # db2 = DAL('sqlite://scheduler_storage.sqlite') > # db2 = DAL('pymysql://root:pass@localhost/testdb2') > db2=DAL('mysql://root:pass@localhost/testdb2') > > # db2 = DAL('MySQLdb://root:pass@localhost/testdb2') > # db2 = DAL('pymysql://root:pass@localhost/testdb1') > > for MySQLdb and pymysql I get the error that they are not supported. mysql > does not give that error but gets stuck in starting the task. > I even tried to import pymysql in web2py.py which did not help with the > error of it being not supported. > > On Monday, January 2, 2017 at 1:38:42 PM UTC-5, Dave S wrote: >> >> >> >> On Monday, January 2, 2017 at 8:22:55 AM UTC-8, Aydin wrote: >>> >>> I used the exact example shown by massimo (https://vimeo.com/27478796) >>> and it gets stuck at (starting single-scheduler for myapp...) and the >>> website does not come up saying browser cannot establish a connection). >>> Running on ubuntu and debian. >>> >> >> Can you show us your connection string (passwords obfuscated)? >> >> /dps >> >> >>> >>> On Monday, January 2, 2017 at 11:04:44 AM UTC-5, Niphlod wrote: >>>> >>>> scheduler definitely works for mysql. >>>> what you experienced is perfectly fine. a scheduler process just sits >>>> there if there is nothing to do (i.e. no tasks to process). >>>> >>>> On Sunday, January 1, 2017 at 5:14:21 PM UTC+1, Aydin wrote: >>>>> >>>>> I have used the scheduler before without being worried about the >>>>> database type. >>>>> I tried to use mysql but it gave an error that it is not supported. I >>>>> have mysql and pymysql installed and created a database "testdb" and used >>>>> the manual format and got that error that it is not supported. >>>>> >>>>> On Saturday, December 31, 2016 at 4:09:23 PM UTC-5, 黄祥 wrote: >>>>>> >>>>>> perhaps, it related with database issue such as : sqlite >>>>>> had you already tried another database like mysql or postgresql? >>>>>> >>>>>> best regards, >>>>>> stifan >>>>>> >>>>> -- 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 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/d/optout.
[web2py] Re: Simple scheduler issue
Sure, here are the databases I have tried to create: # db2 = DAL('sqlite://scheduler_storage.sqlite') # db2 = DAL('pymysql://root:pass@localhost/testdb2') db2=DAL('mysql://root:pass@localhost/testdb2') # db2 = DAL('MySQLdb://root:pass@localhost/testdb2') # db2 = DAL('pymysql://root:pass@localhost/testdb1') for MySQLdb and pymysql I get the error that they are not supported. mysql does not give that error but gets stuck in starting the task. I even tried to import pymysql in web2py.py which did not help with the error of it being not supported. On Monday, January 2, 2017 at 1:38:42 PM UTC-5, Dave S wrote: > > > > On Monday, January 2, 2017 at 8:22:55 AM UTC-8, Aydin wrote: >> >> I used the exact example shown by massimo (https://vimeo.com/27478796) >> and it gets stuck at (starting single-scheduler for myapp...) and the >> website does not come up saying browser cannot establish a connection). >> Running on ubuntu and debian. >> > > Can you show us your connection string (passwords obfuscated)? > > /dps > > >> >> On Monday, January 2, 2017 at 11:04:44 AM UTC-5, Niphlod wrote: >>> >>> scheduler definitely works for mysql. >>> what you experienced is perfectly fine. a scheduler process just sits >>> there if there is nothing to do (i.e. no tasks to process). >>> >>> On Sunday, January 1, 2017 at 5:14:21 PM UTC+1, Aydin wrote: >>>> >>>> I have used the scheduler before without being worried about the >>>> database type. >>>> I tried to use mysql but it gave an error that it is not supported. I >>>> have mysql and pymysql installed and created a database "testdb" and used >>>> the manual format and got that error that it is not supported. >>>> >>>> On Saturday, December 31, 2016 at 4:09:23 PM UTC-5, 黄祥 wrote: >>>>> >>>>> perhaps, it related with database issue such as : sqlite >>>>> had you already tried another database like mysql or postgresql? >>>>> >>>>> best regards, >>>>> stifan >>>>> >>>> -- 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 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/d/optout.
[web2py] Re: Simple scheduler issue
I had defined a task to run every 30 seconds by the way. On Monday, January 2, 2017 at 11:04:44 AM UTC-5, Niphlod wrote: > > scheduler definitely works for mysql. > what you experienced is perfectly fine. a scheduler process just sits > there if there is nothing to do (i.e. no tasks to process). > > On Sunday, January 1, 2017 at 5:14:21 PM UTC+1, Aydin wrote: >> >> I have used the scheduler before without being worried about the database >> type. >> I tried to use mysql but it gave an error that it is not supported. I >> have mysql and pymysql installed and created a database "testdb" and used >> the manual format and got that error that it is not supported. >> >> On Saturday, December 31, 2016 at 4:09:23 PM UTC-5, 黄祥 wrote: >>> >>> perhaps, it related with database issue such as : sqlite >>> had you already tried another database like mysql or postgresql? >>> >>> best regards, >>> stifan >>> >> -- 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 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/d/optout.
[web2py] Re: Simple scheduler issue
I used the exact example shown by massimo (https://vimeo.com/27478796) and it gets stuck at (starting single-scheduler for myapp...) and the website does not come up saying browser cannot establish a connection). Running on ubuntu and debian. On Monday, January 2, 2017 at 11:04:44 AM UTC-5, Niphlod wrote: > > scheduler definitely works for mysql. > what you experienced is perfectly fine. a scheduler process just sits > there if there is nothing to do (i.e. no tasks to process). > > On Sunday, January 1, 2017 at 5:14:21 PM UTC+1, Aydin wrote: >> >> I have used the scheduler before without being worried about the database >> type. >> I tried to use mysql but it gave an error that it is not supported. I >> have mysql and pymysql installed and created a database "testdb" and used >> the manual format and got that error that it is not supported. >> >> On Saturday, December 31, 2016 at 4:09:23 PM UTC-5, 黄祥 wrote: >>> >>> perhaps, it related with database issue such as : sqlite >>> had you already tried another database like mysql or postgresql? >>> >>> best regards, >>> stifan >>> >> -- 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 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/d/optout.
[web2py] Re: Simple scheduler issue
Would that break the connection to the server, because the website does not come up. On Monday, January 2, 2017 at 11:04:44 AM UTC-5, Niphlod wrote: > > scheduler definitely works for mysql. > what you experienced is perfectly fine. a scheduler process just sits > there if there is nothing to do (i.e. no tasks to process). > > On Sunday, January 1, 2017 at 5:14:21 PM UTC+1, Aydin wrote: >> >> I have used the scheduler before without being worried about the database >> type. >> I tried to use mysql but it gave an error that it is not supported. I >> have mysql and pymysql installed and created a database "testdb" and used >> the manual format and got that error that it is not supported. >> >> On Saturday, December 31, 2016 at 4:09:23 PM UTC-5, 黄祥 wrote: >>> >>> perhaps, it related with database issue such as : sqlite >>> had you already tried another database like mysql or postgresql? >>> >>> best regards, >>> stifan >>> >> -- 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 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/d/optout.
[web2py] Web2py scheduler breaks connection tot he server
I cann't get the scheduler run in my ubuntu or debian linux machines. Originally I had db = DAL('sqlite://storage.sqlite') which causes a weird situation where the website becomes unavailable (the browser cannot establish a connection to the server at 127.0.0.1) but when I run the same app without scheduler (without -K appname), and check the app database, it shows that the scheduler task has been running successfully. What is causing connection to the server to break? Second, I tried using pymysql or mysqldb instead of sqlite. but, I get this error "Error in URI 'pymysql' or database not supported" even without -K myapp option. -- 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 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/d/optout.
[web2py] Re: Simple scheduler issue
I have used the scheduler before without being worried about the database type. I tried to use mysql but it gave an error that it is not supported. I have mysql and pymysql installed and created a database "testdb" and used the manual format and got that error that it is not supported. On Saturday, December 31, 2016 at 4:09:23 PM UTC-5, 黄祥 wrote: > > perhaps, it related with database issue such as : sqlite > had you already tried another database like mysql or postgresql? > > best regards, > stifan > -- 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 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/d/optout.
[web2py] Simple scheduler issue
I have a simple task to schedule: def f(): import time return() from gluon.scheduler import Scheduler Scheduler(db,dict(our_function=f)) When I run it with python web2py -K myapp, it gets stuck in "starting single-scheduler for "myapp"..." for long time and if I wait long enough it give "database is locked". While waiting if I try to go to the app in the browser it won't work. Now, if I run the app without scheduler (removing -K myapp), and I go to my scheduler table I can see that the task had run successfully (while it was not accessible) -- 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 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/d/optout.
[web2py] URL (controller function) call with authentication
I am trying to call a a function externally. I have a function: @auth.requires_login() @service.json def func(a): db.table1.insert(data1=a) db.commit() return locals() This has two problems: 1) When I use urllib2.urlopen("https://www.example.com/default/call/func.json/2) which does not have authentication, still it calls the function successfully (which is not intended, the idea is to authenticate the call). 2) When I use the basic authentication using base64, it successfully calls the func but it does not seem that it used the authentication, because I have two users calling func and the the data that is inserted by user1 is also updated for user2 (the idea is to make data unique for each user, just like calling a function that need authentication internally and updating the database. -- 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 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/d/optout.
[web2py] Re: read a field of auth_user
Thanks Anthony, Absolutely worked fine. On Friday, October 7, 2016 at 10:35:33 AM UTC-4, Anthony wrote: > > On Friday, October 7, 2016 at 9:48:45 AM UTC-4, Aydin wrote: >> >> Thanks, information = auth.user.newfield worked as expected. >> I just want to mentioned when I used >> rows = db(db.auth_user.id==auth.user.id).select(db.auth_user.newfield) >> it game me auth_user.newfielddata, data is the string stored in the >> newfield. >> > > Not sure exactly what you mean, but to get the actual field value, do: > > information = db(db.auth_user.id == auth.user.id).select(db.auth_user. > newfield).first().newfield > > Anyway, you really should use auth.user.newfield instead, as it does not > hit the database. > > Anthony > -- 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 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/d/optout.
[web2py] Re: read a field of auth_user
The first one worked:information = auth.user.newfield The second did not:rows = db(db.auth_user.id==auth.user.id ).select(db.auth_user.newfield) On Friday, October 7, 2016 at 9:51:15 AM UTC-4, Marlysson Silva wrote: > > Don't worked? > > Em sexta-feira, 7 de outubro de 2016 10:48:45 UTC-3, Aydin escreveu: >> >> Thanks, information = auth.user.newfield worked as expected. >> I just want to mentioned when I used >> rows = db(db.auth_user.id==auth.user.id).select(db.auth_user.newfield) >> it game me auth_user.newfielddata, data is the string stored in the >> newfield. >> >> >> >> On Friday, October 7, 2016 at 9:40:59 AM UTC-4, Marlysson Silva wrote: >>> >>> Try: >>> >>> information = auth.user.newfield >>> >>> The auth.user contains a copy of auth_user table from current logged in >>> user. >>> >>> Or: >>> >>> rows = db(db.auth_user.id==auth.user.id).select(db.auth_user.newfield) >>> >>> >>> Em sexta-feira, 7 de outubro de 2016 10:00:51 UTC-3, Aydin escreveu: >>>> >>>> This is a simple question but I couldn't find the answer for it. >>>> How can I read a custom field in the auth_user? >>>> I have added a new field to auth_user table by: >>>> auth.settings.extra_fields['auth_user']= [ >>>> Field('newfield','string') >>>> ] >>>> >>>> now I want to read that value in the controller using db().select(...), >>>> but how to say to select() to choose that field of the auth user? >>>> >>> -- 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 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/d/optout.
[web2py] Re: read a field of auth_user
Thanks, information = auth.user.newfield worked as expected. I just want to mentioned when I used rows = db(db.auth_user.id==auth.user.id).select(db.auth_user.newfield) it game me auth_user.newfielddata, data is the string stored in the newfield. On Friday, October 7, 2016 at 9:40:59 AM UTC-4, Marlysson Silva wrote: > > Try: > > information = auth.user.newfield > > The auth.user contains a copy of auth_user table from current logged in > user. > > Or: > > rows = db(db.auth_user.id==auth.user.id).select(db.auth_user.newfield) > > > Em sexta-feira, 7 de outubro de 2016 10:00:51 UTC-3, Aydin escreveu: >> >> This is a simple question but I couldn't find the answer for it. >> How can I read a custom field in the auth_user? >> I have added a new field to auth_user table by: >> auth.settings.extra_fields['auth_user']= [ >> Field('newfield','string') >> ] >> >> now I want to read that value in the controller using db().select(...), >> but how to say to select() to choose that field of the auth user? >> > -- 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 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/d/optout.
[web2py] Re: read a field of auth_user
I tried rows = db().select(db.auth_user.id==auth.user.id).newfield but it did not work On Friday, October 7, 2016 at 9:24:21 AM UTC-4, Aydin wrote: > > Thanks, > > I do not want to read the newfield for all auth users but only for the > current auth user. > > On Friday, October 7, 2016 at 9:05:39 AM UTC-4, 黄祥 wrote: >> >> pls try: >> rows = db().select(db.auth_user.ALL) >> for row in rows: >> print row.newfield >> >> if you want to explicit it : >> rows = db().select(db.auth_user.first_name, db.auth_user.last_name, >> db.auth_user.newfield) >> for row in rows: >> print row.newfield >> >> ref : >> >> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer >> >> best regards, >> stifan >> > -- 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 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/d/optout.
[web2py] Re: read a field of auth_user
Thanks, I do not want to read the newfield for all auth users but only for the current auth user. On Friday, October 7, 2016 at 9:05:39 AM UTC-4, 黄祥 wrote: > > pls try: > rows = db().select(db.auth_user.ALL) > for row in rows: > print row.newfield > > if you want to explicit it : > rows = db().select(db.auth_user.first_name, db.auth_user.last_name, > db.auth_user.newfield) > for row in rows: > print row.newfield > > ref : > > http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer > > best regards, > stifan > -- 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 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/d/optout.
[web2py] read a field of auth_user
This is a simple question but I couldn't find the answer for it. How can I read a custom field in the auth_user? I have added a new field to auth_user table by: auth.settings.extra_fields['auth_user']= [ Field('newfield','string') ] now I want to read that value in the controller using db().select(...), but how to say to select() to choose that field of the auth user? -- 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 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/d/optout.
[web2py] Authenticate using IP address and a password
Could anyone help with one or more of these questions: 1- I have web2py running on a machine and I want to be able to connect to it using an app LOCALLY. I want to use the local IP address of web2py server and a password as authentication. I get the ip address of web2py server and can store it in the database. I know I can access this machine using its ip address on the URL but how can I access it on an app that is running on a server on the internet? Should I ask for the IP address and compare it with the web2py server IP address and also check the password? Can I use web2py authentication? This is happening locally so there is less of security of authentication concern than when it is on the internet. Should I define a new server in the controller like local_auth() in the controller and a form in the login page to get the ip and password and compare and issue the authentication? 2- Is there a way to do two methods of authentication on the same functions? Meaning that I want to do the above authentication when I'm local and connected to the same network and use web2py's authentication using email and password when I'm not local and connected via internet? Appreciate any help, specially if there is an example already developed -- 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 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/d/optout.
[web2py] Re: JSON getting the series data into view
Yes, thats the reason i think. Thanks! -- 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 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/d/optout.
[web2py] Re: JSON getting the series data into view
Sorry that was my mistake, the actual code was:
[web2py] Re: JSON getting the series data into view
Im sure it has to do with my code not web2py. Yes in the browser i did /app/default/getdata and it returned correctly [[1,2],[2,3]]. By the way i import json and also use @service.json. -- 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 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/d/optout.
[web2py] JSON getting the series data into view
The methods to get the data in the view of web2py does not seem working. I used the method mentioned in http://web2py.com/books/default/chapter/29/10/services which is
[web2py] Re: Best way to send data from web2py client to web2py server
Sure, Let's say I have a machine connected running web2py, this will be like a client because the app will be sending data out. I use scheduler to routinely send the data (every 2 min). I want this app send data to a web2py server (has domain like www.example.com). let's say I have two of these machines running web2py as client and will send the data at the same time to my web2py server on www.example.com. I want to know 1) what approaches are out there and which one is more appropriate, 2) is there going to be problem if the web2py server receives data by two machines at the same time. (by the way I cann't use sharing databases because the machines don't have domain associated with them and their ip is dynamic). On Thursday, July 21, 2016 at 11:13:49 AM UTC-4, Anthony wrote: > > On Thursday, July 21, 2016 at 8:22:21 AM UTC-4, Aydin wrote: >> >> Thanks, yes, I know of the forms, I was just wondering if there are other >> services or methods that I may not know. >> > > I think you need to explain more specifically what you are trying to do. > > Anthony > -- 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 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/d/optout.
[web2py] Re: Best way to send data from web2py client to web2py server
Centralized DB, because to process the data on the server that is available by a domain. The data are integers. On Wednesday, July 20, 2016 at 11:22:38 PM UTC-4, Michael Messmer wrote: > > Are you talking about High Availability? Load Balancer and Centralized DB? > Why and what kind of data? > > On Wednesday, July 20, 2016 at 5:59:18 AM UTC-7, Aydin wrote: >> >> What's the best way to send data from web2py clients to a web2py server? >> Especially when there are many web2py clients that at the same time send >> data to the web2py server? Thanks for the help >> > -- 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 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/d/optout.
[web2py] Re: Best way to send data from web2py client to web2py server
Thanks, yes, I know of the forms, I was just wondering if there are other services or methods that I may not know. On Wednesday, July 20, 2016 at 9:07:16 AM UTC-4, Marlysson Silva wrote: > > Using forms? > And web2py get them using request.vars.* > > Em quarta-feira, 20 de julho de 2016 09:59:18 UTC-3, Aydin escreveu: >> >> What's the best way to send data from web2py clients to a web2py server? >> Especially when there are many web2py clients that at the same time send >> data to the web2py server? Thanks for the help >> > -- 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 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/d/optout.
[web2py] Best way to send data from web2py client to web2py server
What's the best way to send data from web2py clients to a web2py server? Especially when there are many web2py clients that at the same time send data to the web2py server? Thanks for the help -- 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 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/d/optout.
[web2py] Re: creating an accessible file with public access
OK, I could read the file. The permission of it was OK; it was that I had a typo in my url. if someone wants to change the permission of a file os.chmod can do it. I'm gonna go with the external sharing of the databases tho. On Tuesday, July 12, 2016 at 4:03:53 PM UTC-4, Aydin wrote: > > I'm using browser to access it. But it returns invalid. It's interesting > because I have other files in static folder and they can be accessed such > as > Web2py.css. > I'm starting to think that maybe when I create the file, it does not give > it permission to read by default. I will check that later. But if that's > the case, then I don't know how to fix it. > That's teally great that I can share the databases externally. I will try > that next too. > -- 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 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/d/optout.
[web2py] Re: creating an accessible file with public access
I'm using browser to access it. But it returns invalid. It's interesting because I have other files in static folder and they can be accessed such as Web2py.css. I'm starting to think that maybe when I create the file, it does not give it permission to read by default. I will check that later. But if that's the case, then I don't know how to fix it. That's teally great that I can share the databases externally. I will try that next too. -- 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 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/d/optout.
[web2py] creating an accessible file with public access
I am creating a file (test.txt) using the following myfile = os.path.join(request.folder, 'static', 'test.txt') f = open(myfile, 'w') f.write('%s' % x) and I like to see it when I do /myapp/static/test.txt, but I cann't. the file has been created and I can see it in that folder. But, I like to make it accessible by public.ultimately, I have another app that will go and read the content of this file. By the way, my attempt is that I have two web2py apps in two different servers and I like app1 to go and read some data from app2 periodically; if there is a better method than above please let me know. I read about sharing the databases between two apps, but that works for when the two apps are in one server.; is that right? -- 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 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/d/optout.
[web2py] Update the database without refreshing the website?
I am running into this issue that the database does not update without refreshing the website. In model db.py I have: db.define_table('Table1', Field('var1', 'integer'), from module1 import insert_record insert_record(db) and in a module1 I write on the database and also get access to the database: from gluon import current def insert_record(db): db = current.db test1 = 2 #for example db.Table1.insert(var=test1) test2 = db().select(db.Table1.var1, orderby=~db.Table1.id, limitby=(0, 1))[0].var1 Then test2 is used to show up on a display. test2 changes because var1 changes. The problem is that test2 does seem to get updated when var1 changes without refreshing the website (I refresh the databases). Is it because this action is in the models? Should I use scheduler to do this? -- 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 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/d/optout.
Re: [web2py] Re: Write in database from modules
In other words, module1 does not seem to run unless I refresh the website. On Tuesday, 8 December 2015 13:28:26 UTC-5, Aydin S wrote: > > Here is what I have: > > In model db.py I have: > > db.define_table('Table1', > Field('var1', 'integer'), > from module1 import insert_record > insert_record(db) > > and in a module1 I write on the database and also get access to the > database: > > from gluon import current > def insert_record(db): > db = current.db > test1 = 2 #for example > db.Table1.insert(var=test1) > test2 = db().select(db.Table1.var1, orderby=~db.Table1.id, > limitby=(0, 1))[0].var1 > > Then test2 is used to show up on a display. test2 changes because var1 > changes. The problem is that test2 does seem to get updated when var1 > changes without refreshing the website (I refresh the databases). Is it > because this action is in the models? Should I use scheduler to do this? > > On Tuesday, 8 December 2015 13:15:38 UTC-5, Richard wrote: >> >> Difficult to say without seeing the code, you may need db.commit() or not. >> >> Richard >> >> On Tue, Dec 8, 2015 at 1:05 PM, Aydin S <hsof...@gmail.com> wrote: >> >>> I got another question if you could help. >>> The database does not get updated without I refresh the website in this >>> scenario. I don't know why it is, do I need to use commit() somewhere or >>> since this is in the models it will not run as the variable inside the >>> module changes? Do I have to use scheduler? Any idea? >>> >>> On Monday, 7 December 2015 18:56:10 UTC-5, Hans Soflao wrote: >>>> >>>> Thanks Anthony and Richard. >>>> Yes, my variable was inside the module and was not a global one. Thanks >>>> for the link, I am running the variable inside the function and it is >>>> local. >>>> I tested the code and it worked. >>>> >>>> On Monday, December 7, 2015 at 12:44:40 PM UTC-5, Richard wrote: >>>>> >>>>> @Hans, what is your question about variable in module exactly? >>>>> >>>>> What you did seems correct to me... >>>>> >>>>> About "db = current.db" be aware of that : >>>>> http://web2py.com/books/default/chapter/29/04/the-core#Warning--Do-not-use-the-current-object-in-global-scope-in-a-module >>>>> >>>>> On Mon, Dec 7, 2015 at 12:13 PM, Hans Soflao <hans...@gmail.com> >>>>> wrote: >>>>> >>>>>> Thank you, I used the method Anthony mentioned and it worked. >>>>>> Now a follow up question, in order to have access to database in this >>>>>> module to assign var1 (defined in the database) to var2 (defined in the >>>>>> module) what is the best method? >>>>>> >>>>>> For instance to have access to the latest row of data in the table1 >>>>>> defined in the model as >>>>>> db.define_table('Table1', >>>>>> Field('F1', 'integer')) >>>>>> >>>>>> should I have in the model the following?: >>>>>> >>>>>> from gluon import current >>>>>> current.db = db >>>>>> >>>>>> and in the module module1.py?: >>>>>> >>>>>> def module1(): >>>>>> db = current.db >>>>>> var2=db().select(db.Table1.var1, orderby=~db.Table1.id, >>>>>> limitby=(0, 1))[0].var1 >>>>>> >>>>>> Thanks >>>>>> >>>>>> >>>>>> >>>>>> On Friday, December 4, 2015 at 9:39:35 AM UTC-5, Aydin S wrote: >>>>>> >>>>>>> This might be asked before and I already found a similar question in >>>>>>> here: https://groups.google.com/forum/#!topic/web2py/0k0Fvw6fmb8 >>>>>>> but this seemed a bit confusing. How to write on database from >>>>>>> within a module? >>>>>>> I have a table defined in db.py (model) as follows: >>>>>>> db.define_table('Table1', >>>>>>> Field('F1', 'integer')) >>>>>>> >>>>>>> Now I have a variable var1 in the module module1.py that I want to >>>>>>> write it into F1. >>>>>>> >>>>>>> var1=2 >>>>>>> >>>>>>> Is this similar approach t
Re: [web2py] Re: Write in database from modules
Here is what I have: In model db.py I have: db.define_table('Table1', Field('var1', 'integer'), from module1 import insert_record insert_record(db) and in a module1 I write on the database and also get access to the database: from gluon import current def insert_record(db): db = current.db test1 = 2 #for example db.Table1.insert(var=test1) test2 = db().select(db.Table1.var1, orderby=~db.Table1.id, limitby=(0, 1))[0].var1 Then test2 is used to show up on a display. test2 changes because var1 changes. The problem is that test2 does seem to get updated when var1 changes without refreshing the website (I refresh the databases). Is it because this action is in the models? Should I use scheduler to do this? On Tuesday, 8 December 2015 13:15:38 UTC-5, Richard wrote: > > Difficult to say without seeing the code, you may need db.commit() or not. > > Richard > > On Tue, Dec 8, 2015 at 1:05 PM, Aydin S <hsof...@gmail.com > > wrote: > >> I got another question if you could help. >> The database does not get updated without I refresh the website in this >> scenario. I don't know why it is, do I need to use commit() somewhere or >> since this is in the models it will not run as the variable inside the >> module changes? Do I have to use scheduler? Any idea? >> >> On Monday, 7 December 2015 18:56:10 UTC-5, Hans Soflao wrote: >>> >>> Thanks Anthony and Richard. >>> Yes, my variable was inside the module and was not a global one. Thanks >>> for the link, I am running the variable inside the function and it is local. >>> I tested the code and it worked. >>> >>> On Monday, December 7, 2015 at 12:44:40 PM UTC-5, Richard wrote: >>>> >>>> @Hans, what is your question about variable in module exactly? >>>> >>>> What you did seems correct to me... >>>> >>>> About "db = current.db" be aware of that : >>>> http://web2py.com/books/default/chapter/29/04/the-core#Warning--Do-not-use-the-current-object-in-global-scope-in-a-module >>>> >>>> On Mon, Dec 7, 2015 at 12:13 PM, Hans Soflao <hans...@gmail.com> wrote: >>>> >>>>> Thank you, I used the method Anthony mentioned and it worked. >>>>> Now a follow up question, in order to have access to database in this >>>>> module to assign var1 (defined in the database) to var2 (defined in the >>>>> module) what is the best method? >>>>> >>>>> For instance to have access to the latest row of data in the table1 >>>>> defined in the model as >>>>> db.define_table('Table1', >>>>> Field('F1', 'integer')) >>>>> >>>>> should I have in the model the following?: >>>>> >>>>> from gluon import current >>>>> current.db = db >>>>> >>>>> and in the module module1.py?: >>>>> >>>>> def module1(): >>>>> db = current.db >>>>> var2=db().select(db.Table1.var1, orderby=~db.Table1.id, >>>>> limitby=(0, 1))[0].var1 >>>>> >>>>> Thanks >>>>> >>>>> >>>>> >>>>> On Friday, December 4, 2015 at 9:39:35 AM UTC-5, Aydin S wrote: >>>>> >>>>>> This might be asked before and I already found a similar question in >>>>>> here: https://groups.google.com/forum/#!topic/web2py/0k0Fvw6fmb8 >>>>>> but this seemed a bit confusing. How to write on database from within >>>>>> a module? >>>>>> I have a table defined in db.py (model) as follows: >>>>>> db.define_table('Table1', >>>>>> Field('F1', 'integer')) >>>>>> >>>>>> Now I have a variable var1 in the module module1.py that I want to >>>>>> write it into F1. >>>>>> >>>>>> var1=2 >>>>>> >>>>>> Is this similar approach to read a variable from database in a module? >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>> 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 because you are subscribed to the Google >>>>> Groups "web2
Re: [web2py] Re: Write in database from modules
I got another question if you could help. The database does not get updated without I refresh the website in this scenario. I don't know why it is, do I need to use commit() somewhere or since this is in the models it will not run as the variable inside the module changes? Do I have to use scheduler? Any idea? On Monday, 7 December 2015 18:56:10 UTC-5, Hans Soflao wrote: > > Thanks Anthony and Richard. > Yes, my variable was inside the module and was not a global one. Thanks > for the link, I am running the variable inside the function and it is local. > I tested the code and it worked. > > On Monday, December 7, 2015 at 12:44:40 PM UTC-5, Richard wrote: >> >> @Hans, what is your question about variable in module exactly? >> >> What you did seems correct to me... >> >> About "db = current.db" be aware of that : >> http://web2py.com/books/default/chapter/29/04/the-core#Warning--Do-not-use-the-current-object-in-global-scope-in-a-module >> >> On Mon, Dec 7, 2015 at 12:13 PM, Hans Soflao <hans...@gmail.com> wrote: >> >>> Thank you, I used the method Anthony mentioned and it worked. >>> Now a follow up question, in order to have access to database in this >>> module to assign var1 (defined in the database) to var2 (defined in the >>> module) what is the best method? >>> >>> For instance to have access to the latest row of data in the table1 >>> defined in the model as >>> db.define_table('Table1', >>> Field('F1', 'integer')) >>> >>> should I have in the model the following?: >>> >>> from gluon import current >>> current.db = db >>> >>> and in the module module1.py?: >>> >>> def module1(): >>> db = current.db >>> var2=db().select(db.Table1.var1, orderby=~db.Table1.id, limitby=(0, >>> 1))[0].var1 >>> >>> Thanks >>> >>> >>> >>> On Friday, December 4, 2015 at 9:39:35 AM UTC-5, Aydin S wrote: >>> >>>> This might be asked before and I already found a similar question in >>>> here: https://groups.google.com/forum/#!topic/web2py/0k0Fvw6fmb8 >>>> but this seemed a bit confusing. How to write on database from within a >>>> module? >>>> I have a table defined in db.py (model) as follows: >>>> db.define_table('Table1', >>>> Field('F1', 'integer')) >>>> >>>> Now I have a variable var1 in the module module1.py that I want to >>>> write it into F1. >>>> >>>> var1=2 >>>> >>>> Is this similar approach to read a variable from database in a module? >>>> >>>> >>>> >>>> -- >>> 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 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/d/optout. >>> >> >> -- 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 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/d/optout.
Re: [web2py] Re: Write in database from modules
I am testing it with a test code which is exactly what I wrote so there is only one table with my field. I think it makes sense, that's why there is scheduler and cron developed for web2py. I'm trying to understand if I should run model1.py (where the module1 is imported) as a web2py cron or scheduled task. On Tuesday, 8 December 2015 13:58:37 UTC-5, Richard wrote: > > 15 seconds... how many tables does your app has? I think you are doing > something wrong somewhere... > > Richard > > On Tue, Dec 8, 2015 at 1:53 PM, Aydin S <hsof...@gmail.com > > wrote: > >> I realized the data gets updated but it takes around 15 seconds which I >> think it is what the model1.py routinely runs. This is a problem for me >> because I want it to run faster. >> >> >> On Tuesday, 8 December 2015 13:37:42 UTC-5, Richard wrote: >>> >>> Notice if you chage your module file you need to restart web2py... Or >>> user track change feature, but in the past it was broken don't know if now >>> it works properly... >>> http://web2py.com/books/default/chapter/29/04/the-core?search=track_changes >>> >>> On Tue, Dec 8, 2015 at 1:33 PM, Aydin S <hsof...@gmail.com> wrote: >>> >>>> In other words, module1 does not seem to run unless I refresh the >>>> website. >>>> >>>> On Tuesday, 8 December 2015 13:28:26 UTC-5, Aydin S wrote: >>>>> >>>>> Here is what I have: >>>>> >>>>> In model db.py I have: >>>>> >>>>> db.define_table('Table1', >>>>> Field('var1', 'integer'), >>>>> from module1 import insert_record >>>>> insert_record(db) >>>>> >>>>> and in a module1 I write on the database and also get access to the >>>>> database: >>>>> >>>>> from gluon import current >>>>> def insert_record(db): >>>>> db = current.db >>>>> test1 = 2 #for example >>>>> db.Table1.insert(var=test1) >>>>> test2 = db().select(db.Table1.var1, orderby=~db.Table1.id, >>>>> limitby=(0, 1))[0].var1 >>>>> >>>>> Then test2 is used to show up on a display. test2 changes because var1 >>>>> changes. The problem is that test2 does seem to get updated when var1 >>>>> changes without refreshing the website (I refresh the databases). Is it >>>>> because this action is in the models? Should I use scheduler to do this? >>>>> >>>>> On Tuesday, 8 December 2015 13:15:38 UTC-5, Richard wrote: >>>>>> >>>>>> Difficult to say without seeing the code, you may need db.commit() or >>>>>> not. >>>>>> >>>>>> Richard >>>>>> >>>>>> On Tue, Dec 8, 2015 at 1:05 PM, Aydin S <hsof...@gmail.com> wrote: >>>>>> >>>>>>> I got another question if you could help. >>>>>>> The database does not get updated without I refresh the website in >>>>>>> this scenario. I don't know why it is, do I need to use commit() >>>>>>> somewhere >>>>>>> or since this is in the models it will not run as the variable inside >>>>>>> the >>>>>>> module changes? Do I have to use scheduler? Any idea? >>>>>>> >>>>>>> On Monday, 7 December 2015 18:56:10 UTC-5, Hans Soflao wrote: >>>>>>>> >>>>>>>> Thanks Anthony and Richard. >>>>>>>> Yes, my variable was inside the module and was not a global one. >>>>>>>> Thanks for the link, I am running the variable inside the function and >>>>>>>> it >>>>>>>> is local. >>>>>>>> I tested the code and it worked. >>>>>>>> >>>>>>>> On Monday, December 7, 2015 at 12:44:40 PM UTC-5, Richard wrote: >>>>>>>>> >>>>>>>>> @Hans, what is your question about variable in module exactly? >>>>>>>>> >>>>>>>>> What you did seems correct to me... >>>>>>>>> >>>>>>>>> About "db = current.db" be aware of that : >>>>>>>>> http://web2py.com/books/default/chapter/29/04/the-core#Warning--Do-not-use-the-current-object-in-global-scope-in-a-module &g
Re: [web2py] Re: Write in database from modules
I realized the data gets updated but it takes around 15 seconds which I think it is what the model1.py routinely runs. This is a problem for me because I want it to run faster. On Tuesday, 8 December 2015 13:37:42 UTC-5, Richard wrote: > > Notice if you chage your module file you need to restart web2py... Or user > track change feature, but in the past it was broken don't know if now it > works properly... > http://web2py.com/books/default/chapter/29/04/the-core?search=track_changes > > On Tue, Dec 8, 2015 at 1:33 PM, Aydin S <hsof...@gmail.com > > wrote: > >> In other words, module1 does not seem to run unless I refresh the >> website. >> >> On Tuesday, 8 December 2015 13:28:26 UTC-5, Aydin S wrote: >>> >>> Here is what I have: >>> >>> In model db.py I have: >>> >>> db.define_table('Table1', >>> Field('var1', 'integer'), >>> from module1 import insert_record >>> insert_record(db) >>> >>> and in a module1 I write on the database and also get access to the >>> database: >>> >>> from gluon import current >>> def insert_record(db): >>> db = current.db >>> test1 = 2 #for example >>> db.Table1.insert(var=test1) >>> test2 = db().select(db.Table1.var1, orderby=~db.Table1.id, >>> limitby=(0, 1))[0].var1 >>> >>> Then test2 is used to show up on a display. test2 changes because var1 >>> changes. The problem is that test2 does seem to get updated when var1 >>> changes without refreshing the website (I refresh the databases). Is it >>> because this action is in the models? Should I use scheduler to do this? >>> >>> On Tuesday, 8 December 2015 13:15:38 UTC-5, Richard wrote: >>>> >>>> Difficult to say without seeing the code, you may need db.commit() or >>>> not. >>>> >>>> Richard >>>> >>>> On Tue, Dec 8, 2015 at 1:05 PM, Aydin S <hsof...@gmail.com> wrote: >>>> >>>>> I got another question if you could help. >>>>> The database does not get updated without I refresh the website in >>>>> this scenario. I don't know why it is, do I need to use commit() >>>>> somewhere >>>>> or since this is in the models it will not run as the variable inside the >>>>> module changes? Do I have to use scheduler? Any idea? >>>>> >>>>> On Monday, 7 December 2015 18:56:10 UTC-5, Hans Soflao wrote: >>>>>> >>>>>> Thanks Anthony and Richard. >>>>>> Yes, my variable was inside the module and was not a global one. >>>>>> Thanks for the link, I am running the variable inside the function and >>>>>> it >>>>>> is local. >>>>>> I tested the code and it worked. >>>>>> >>>>>> On Monday, December 7, 2015 at 12:44:40 PM UTC-5, Richard wrote: >>>>>>> >>>>>>> @Hans, what is your question about variable in module exactly? >>>>>>> >>>>>>> What you did seems correct to me... >>>>>>> >>>>>>> About "db = current.db" be aware of that : >>>>>>> http://web2py.com/books/default/chapter/29/04/the-core#Warning--Do-not-use-the-current-object-in-global-scope-in-a-module >>>>>>> >>>>>>> On Mon, Dec 7, 2015 at 12:13 PM, Hans Soflao <hans...@gmail.com> >>>>>>> wrote: >>>>>>> >>>>>>>> Thank you, I used the method Anthony mentioned and it worked. >>>>>>>> Now a follow up question, in order to have access to database in >>>>>>>> this module to assign var1 (defined in the database) to var2 (defined >>>>>>>> in >>>>>>>> the module) what is the best method? >>>>>>>> >>>>>>>> For instance to have access to the latest row of data in the table1 >>>>>>>> defined in the model as >>>>>>>> db.define_table('Table1', >>>>>>>> Field('F1', 'integer')) >>>>>>>> >>>>>>>> should I have in the model the following?: >>>>>>>> >>>>>>>> from gluon import current >>>>>>>> current.db = db >>>>>>>> >>>>>>>> and in the module
Re: [web2py] Re: Write in database from modules
I think when a table gets updated on the web it already refreshes the databases immediately and the data gets written, but I think the models routinely run or there is a delay of about 15 second after you update the data in a module to get into the database. On Tuesday, 8 December 2015 14:03:31 UTC-5, Aydin S wrote: > > I am testing it with a test code which is exactly what I wrote so there is > only one table with my field. > I think it makes sense, that's why there is scheduler and cron developed > for web2py. I'm trying to understand if I should run model1.py (where the > module1 is imported) as a web2py cron or scheduled task. > > On Tuesday, 8 December 2015 13:58:37 UTC-5, Richard wrote: >> >> 15 seconds... how many tables does your app has? I think you are doing >> something wrong somewhere... >> >> Richard >> >> On Tue, Dec 8, 2015 at 1:53 PM, Aydin S <hsof...@gmail.com> wrote: >> >>> I realized the data gets updated but it takes around 15 seconds which I >>> think it is what the model1.py routinely runs. This is a problem for me >>> because I want it to run faster. >>> >>> >>> On Tuesday, 8 December 2015 13:37:42 UTC-5, Richard wrote: >>>> >>>> Notice if you chage your module file you need to restart web2py... Or >>>> user track change feature, but in the past it was broken don't know if now >>>> it works properly... >>>> http://web2py.com/books/default/chapter/29/04/the-core?search=track_changes >>>> >>>> On Tue, Dec 8, 2015 at 1:33 PM, Aydin S <hsof...@gmail.com> wrote: >>>> >>>>> In other words, module1 does not seem to run unless I refresh the >>>>> website. >>>>> >>>>> On Tuesday, 8 December 2015 13:28:26 UTC-5, Aydin S wrote: >>>>>> >>>>>> Here is what I have: >>>>>> >>>>>> In model db.py I have: >>>>>> >>>>>> db.define_table('Table1', >>>>>> Field('var1', 'integer'), >>>>>> from module1 import insert_record >>>>>> insert_record(db) >>>>>> >>>>>> and in a module1 I write on the database and also get access to the >>>>>> database: >>>>>> >>>>>> from gluon import current >>>>>> def insert_record(db): >>>>>> db = current.db >>>>>> test1 = 2 #for example >>>>>> db.Table1.insert(var=test1) >>>>>> test2 = db().select(db.Table1.var1, orderby=~db.Table1.id, >>>>>> limitby=(0, 1))[0].var1 >>>>>> >>>>>> Then test2 is used to show up on a display. test2 changes because >>>>>> var1 changes. The problem is that test2 does seem to get updated when >>>>>> var1 >>>>>> changes without refreshing the website (I refresh the databases). Is it >>>>>> because this action is in the models? Should I use scheduler to do this? >>>>>> >>>>>> On Tuesday, 8 December 2015 13:15:38 UTC-5, Richard wrote: >>>>>>> >>>>>>> Difficult to say without seeing the code, you may need db.commit() >>>>>>> or not. >>>>>>> >>>>>>> Richard >>>>>>> >>>>>>> On Tue, Dec 8, 2015 at 1:05 PM, Aydin S <hsof...@gmail.com> wrote: >>>>>>> >>>>>>>> I got another question if you could help. >>>>>>>> The database does not get updated without I refresh the website in >>>>>>>> this scenario. I don't know why it is, do I need to use commit() >>>>>>>> somewhere >>>>>>>> or since this is in the models it will not run as the variable inside >>>>>>>> the >>>>>>>> module changes? Do I have to use scheduler? Any idea? >>>>>>>> >>>>>>>> On Monday, 7 December 2015 18:56:10 UTC-5, Hans Soflao wrote: >>>>>>>>> >>>>>>>>> Thanks Anthony and Richard. >>>>>>>>> Yes, my variable was inside the module and was not a global one. >>>>>>>>> Thanks for the link, I am running the variable inside the function >>>>>>>>> and it >>>>>>>>> is local. >>>>>>>>> I tested th
Re: [web2py] Re: Write in database from modules
Thanks, that makes sense. Ok test2 in the above code comes from a potentiometer that is sensed inside the module. Right now I'm not really doing anything specific and I'm using the code I put in here; I'm just trying to learn. So what you said matches with my tests that with http request it gets updated. I have rephrase that to clarify. If I do http request the database gets updated immediately. If I don't do http request data gets updated in about 15 second. Based on what you said, and the fact that I want it to be faster I may have to use scheduler. I think scheduler can do it in 1 second minimum. So the web2py crib has been removed? -- 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 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/d/optout.
[web2py] Write in database from modules
This might be asked before and I already found a similar question in here: https://groups.google.com/forum/#!topic/web2py/0k0Fvw6fmb8 but this seemed a bit confusing. How to write on database from within a module? I have a table defined in db.py (model) as follows: db.define_table('Table1', Field('F1', 'integer')) Now I have a variable var1 in the module module1.py that I want to write it into F1. var1=2 Is this similar approach to read a variable from database in a module? -- 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 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/d/optout.
[web2py] images in {{for index,image in enumerate(images):}} of my tiny website app.
I am trying to learn from "my tiny website" app and use the slide show that it is used there in the "images/images.html" view. I created a new view like default/mynewpage.html and copied "images/images.html" view into it; when I ran it there was an error " "images" is not defined. I did some debugging, I found out it is about line 10 in the "images/images.html" view that causes this error: {{for index,image in enumerate(images):}} the whole view is like this: {{extend 'layout.html'}} {{for page in pages:}} {{for index,image in enumerate([i for i in images if i.page==page]):}} {{if index==0:}} {{else:}} {{pass}} {{if auth.has_membership('manager'):}} {{=manager_toolbar(image.id)}} {{pass}} {{pass}} {{pass}} what's happening here is that it looks like the "image" table that has "images" field in it is not accessible by my new page; any help or suggestion to debug this? thanks... -- 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 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/d/optout.
[web2py] Can web2py have two scheduler tasks?
I'm trying to create a second model and use scheduler to run it periodically, but an error happens that the table exist already. I use this at the end of the model: from gluon.scheduler import Scheduler Scheduler(db,dict(function=f)) And the error is correct because the first model that has the above code has already created a table called scheduler_task.table and its relative tables. My question is is there a way to name the tables differently so that I could run two separate models using scheduler? -- 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 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/d/optout.
[web2py] Interrupts in the web2py environment?
Is there a way to create interrupts in the web2py environment? -- 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 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/d/optout.
[web2py] Re: Can web2py have two scheduler tasks?
I'm trying to run two different function with two different periodic times. I think what you mean is that I still can do it using from gluon.scheduler import Scheduler Scheduler(db,dict(function1=f1,function2=f2)) and then in the schedule use function1 and function2 to create two different periodic tasks. I've tried this, and it did not work. On Sunday, 5 July 2015 10:44:18 UTC-4, Anthony wrote: Once the scheduler has been defined, you can run tasks from anywhere. Why do you need to define it again in another model file? -- 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 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/d/optout.
[web2py] Re: Can web2py have two scheduler tasks?
Thanks for the guidance, it worked after correcting the format I was creating new tasks. On Sunday, 5 July 2015 15:08:43 UTC-4, Anthony wrote: On Sunday, July 5, 2015 at 11:15:56 AM UTC-4, Aydin S wrote: I'm trying to run two different function with two different periodic times. I think what you mean is that I still can do it using from gluon.scheduler import Scheduler Scheduler(db,dict(function1=f1,function2=f2)) and then in the schedule use function1 and function2 to create two different periodic tasks. I've tried this, and it did not work. Please read the Scheduler documentation: http://web2py.com/books/default/chapter/29/04/the-core#web2py-Scheduler. Your second line should be something like: scheduler = Scheduler(db, ...) otherwise, you will have no way to refer to the Scheduler object later in your code when you want to schedule a task. Just make sure function1 and function2 have been defined (or imported from a module) before the above lines. If for some reason you need to define one of the functions later, note that the second argument to Scheduler() is optional (i.e., you don't have to provide a dictionary mapping task names to functions -- you can instead pass a function directly to scheduler.queue_task when you actually queue a task). I think you can also update the task dictionary at a later point: scheduler.tasks.update('new_task'=new_function) Anthony -- 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 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/d/optout.
[web2py] initilize GPIO in web2py-Scheduler
I'm trying to set a pin to high (for instance) in a periodic way using web2py in an embedded linux. I set the GPIO to output for example : GPIO.setup(pin 20, output) and then if xy GPIO.setup(pin 20, high) and run the scheduler every 10 second The problem with this is that every 10 second when it gets to the line which sets the pin to be output, it turns it low (that's the default). I am frustrated with scheduler to get it to run two functions so that I can put the pin initialization in one which runs only at startup. I tried to use the crontab -e and initialize there, but it looks like web2py models does not have access to those and failed to run. I've been thinking to make a creative way to bypass GPIO setup after first run of scheduler and I was successful but scheduler fails in the second repeat because does not know the setup apparently. Web2py experts please help me find out the solutionThanks -- 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 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/d/optout.
[web2py] Re: An approach to initialize a linux running machine using web2py
Thanks, yes the web2py is started from /etc/init.d I wonder if I do that the imported pins will be in the web2py environment? On Wednesday, 20 May 2015 17:50:11 UTC-4, Dave S wrote: On Wednesday, May 20, 2015 at 1:56:50 PM UTC-7, Aydin S wrote: I'm trying to set a GPOI pin to be output. I do not want to repeat this, I want this to happen only one time like (set pin 10 to output). And I want this to happen only every time web2py is started. Thanks. For that, I;d make a stand-alone program to set the pin, and then a shell script to invoke that program and then start web2py. Are you starting web2py from something in /etc, from a login script, or from an nginx configuration file? /dps On Wednesday, 20 May 2015 15:45:10 UTC-4, Dave S wrote: On Wednesday, May 20, 2015 at 12:28:37 PM UTC-7, Aydin S wrote: I want to initialize a few things on a linux machine running web2py server. Meaning that a init.py file to be run in the boot, things initilized in init.py will be used in web2py environment, can scheduler do it? If so, I should set the number of repeats to 1? Are you specifically interested in setting environmental variables, or making links, or doing something like generating index files on the DB, or maybe generating new content (for example, making PDF files from some nightly update)? /dps -- 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 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/d/optout.
Re: [web2py] Error in scheduler
Thanks for the response, it gives the same response. In general what's the right way to define more than one scheduled tasks? I have tried both the following and non worked: 1- Create to models and define each function in there (and set migrate=False) 2- Define two functions in the same model (and set migrate=False) On Thursday, 21 May 2015 02:57:53 UTC-4, Massimiliano wrote: Just set: migrate=False so it doesn't try to recreate the table from gluon.scheduler import Scheduler scheduler = Scheduler(db,tasks=dict(our_function=f), migrate=False) On Wed, May 20, 2015 at 9:25 PM, Aydin S hsof...@gmail.com javascript: wrote: When I try to create a new model in web2py for scheduller I get an error. The model is as follows `def f(): a = 2 return () from gluon.scheduler import Scheduler scheduler = Scheduler(db,dict(our_function=f)) I get the following error: ` Traceback (most recent call last): File /home/www-data/web2py/gluon/restricted.py, line 227, in restricted exec ccode in environment File /home/www-data/web2py/applications/Home_Lights/models/mtasks.py, line `42, in module` Scheduler(db,dict(our_function=f)) File /home/www-data/web2py/gluon/scheduler.py, line 587, in __init__ self.define_tables(db, migrate=migrate) File /home/www-data/web2py/gluon/scheduler.py, line 655, in define_tables format='%(task_name)s') File /home/www-data/web2py/gluon/packages/dal/pydal/base.py, line 799, in `define_table` raise SyntaxError('table already defined: %s' % tablename) SyntaxError: table already defined: scheduler_task` I suspect it has to do with the execution permission of the newly created model. any help is appreciated...? -- 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 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 javascript:. For more options, visit https://groups.google.com/d/optout. -- Massimiliano -- 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 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/d/optout.
[web2py] Error in scheduler
When I try to create a new model in web2py for scheduller I get an error. The model is as follows `def f(): a = 2 return () from gluon.scheduler import Scheduler scheduler = Scheduler(db,dict(our_function=f)) I get the following error: ` Traceback (most recent call last): File /home/www-data/web2py/gluon/restricted.py, line 227, in restricted exec ccode in environment File /home/www-data/web2py/applications/Home_Lights/models/mtasks.py, line `42, in module` Scheduler(db,dict(our_function=f)) File /home/www-data/web2py/gluon/scheduler.py, line 587, in __init__ self.define_tables(db, migrate=migrate) File /home/www-data/web2py/gluon/scheduler.py, line 655, in define_tables format='%(task_name)s') File /home/www-data/web2py/gluon/packages/dal/pydal/base.py, line 799, in `define_table` raise SyntaxError('table already defined: %s' % tablename) SyntaxError: table already defined: scheduler_task` I suspect it has to do with the execution permission of the newly created model. any help is appreciated...? -- 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 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/d/optout.
[web2py] Re: An approach to initialize a linux running machine using web2py
I'm trying to set a GPOI pin to be output. I do not want to repeat this, I want this to happen only one time like (set pin 10 to output). And I want this to happen only every time web2py is started. Thanks. On Wednesday, 20 May 2015 15:45:10 UTC-4, Dave S wrote: On Wednesday, May 20, 2015 at 12:28:37 PM UTC-7, Aydin S wrote: I want to initialize a few things on a linux machine running web2py server. Meaning that a init.py file to be run in the boot, things initilized in init.py will be used in web2py environment, can scheduler do it? If so, I should set the number of repeats to 1? Are you specifically interested in setting environmental variables, or making links, or doing something like generating index files on the DB, or maybe generating new content (for example, making PDF files from some nightly update)? /dps -- 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 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/d/optout.
[web2py] An approach to initialize a linux running machine using web2py
I want to initialize a few things on a linux machine running web2py server. Meaning that a init.py file to be run in the boot, things initilized in init.py will be used in web2py environment, can scheduler do it? If so, I should set the number of repeats to 1? -- 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 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/d/optout.
[web2py] Re: Form to get a value and process
Thanks Anthony, This works fine, I also added the field name because I want to get the value not the ID, so I used: db(db.Table1).select(db.Table1.X, orderby=~db.Table1.id, limitby=(0, 1)) However, this does not return the value, I used: def index(): form = SQLFORM(db.Temp).process() X = db(db.Table1).select(db.Table1.X, orderby=~db.Table1.id, limitby=(0, 1)) return (form=form,X=X) Then I printed t in the view saying {{=t}} which returns: Table1.X 10 As you see this is a column, what I want is the number 10 only. Sorry if this is so basic issue. On Wednesday, 29 April 2015 10:17:57 UTC-4, Anthony wrote: db.Table1.X is just a field object and doesn't refer to any record in the database. To retrieve a record, you must create a query. In most databases, you can just take the record with the largest ID: db(db.Table1).select(orderby=~db.Table1.id, limitby=(0, 1)) That sorts in reverse order based on ID and takes the first record. Alternatively, you could include a record creation timestamp and sort based on that. Anthony On Wednesday, April 29, 2015 at 9:31:50 AM UTC-4, Aydin S wrote: Thank you, you are right, right now I have: def index(): form = SQLFORM(db.X).process() return dict(form=form) and I see the database getting updated with new records. One last question, I use db.Table1.X to refer to the last entered record. However, this does not work. How can I make it use the last entered row? On Wednesday, 29 April 2015 08:27:22 UTC-4, Anthony wrote: See answer on SO: http://stackoverflow.com/a/29932995/440323 On Tuesday, April 28, 2015 at 9:35:31 PM UTC-4, Aydin S wrote: It looks like the scheduler which is a model file does not see variable X in the database! On Tuesday, 28 April 2015 21:19:14 UTC-4, Aydin S wrote: No, the value of the form gets processed every time the scheduler runs. On Tuesday, 28 April 2015 21:07:42 UTC-4, Dave S wrote: On Tuesday, April 28, 2015 at 6:01:04 PM UTC-7, Aydin S wrote: This is probably very simple, sorry in advance! I have a form defined in a model file: db.define_table('table1', Field('X', 'integer')) I have a controller that is also defined as: def index(): form = SQLFORM(db.X) return dict(form=form) In my index view file I have: h2Input form/h2 {{=form}} I want to use value X in a scheduler defined as a model like: A = X+2 The form shows up as expected. I enter a value in it and submit it. The scheduler is running as expected. However it looks like the value X never gets set to what I enter. Any idea? Do you process the form once the user has entered the input? /dps -- 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 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/d/optout.
[web2py] Re: Form to get a value and process
Yes, I got it, thanks. There is one problem regarding scheduler though. In my controller I have: def index(): form = SQLFORM(db.Table1).process() P = db().select(db.Table1.X, orderby=~db.Table1.id, limitby=(0, 1)) row = P[0] final = row.X return dict(form=form, final=final) In the view this exactly show the value of the record which I wanted. Then in my scheduler I use final as follows: if final 10 On Wednesday, 29 April 2015 15:35:27 UTC-4, Anthony wrote: Note, this is all covered in the online documentation -- I suggest you skim through the chapter on the DAL: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer A select returns a Rows object. You must then extract an individual Row from it, and then the individual field value from the Row. In your case, you want: X[0].X Anthony On Wednesday, April 29, 2015 at 2:38:05 PM UTC-4, Aydin S wrote: Thanks Anthony, This works fine, I also added the field name because I want to get only the value of X, so I used: db(db.Table1).select(db.Table1.X, orderby=~db.Table1.id, limitby=(0, 1)) However, this does not return the value, I used: def index(): form = SQLFORM(db.Temp).process() X = db(db.Table1).select(db.Table1.X, orderby=~db.Table1.id, limitby=(0, 1)) return (form=form,X=X) Then I printed X in the view using {{=X}} which returns: Table1.X 10 As you see this is a column, what I want is the number 10 only. Sorry if this is so basic issue. On Wednesday, 29 April 2015 10:17:57 UTC-4, Anthony wrote: db.Table1.X is just a field object and doesn't refer to any record in the database. To retrieve a record, you must create a query. In most databases, you can just take the record with the largest ID: db(db.Table1).select(orderby=~db.Table1.id, limitby=(0, 1)) That sorts in reverse order based on ID and takes the first record. Alternatively, you could include a record creation timestamp and sort based on that. Anthony On Wednesday, April 29, 2015 at 9:31:50 AM UTC-4, Aydin S wrote: Thank you, you are right, right now I have: def index(): form = SQLFORM(db.X).process() return dict(form=form) and I see the database getting updated with new records. One last question, I use db.Table1.X to refer to the last entered record. However, this does not work. How can I make it use the last entered row? On Wednesday, 29 April 2015 08:27:22 UTC-4, Anthony wrote: See answer on SO: http://stackoverflow.com/a/29932995/440323 On Tuesday, April 28, 2015 at 9:35:31 PM UTC-4, Aydin S wrote: It looks like the scheduler which is a model file does not see variable X in the database! On Tuesday, 28 April 2015 21:19:14 UTC-4, Aydin S wrote: No, the value of the form gets processed every time the scheduler runs. On Tuesday, 28 April 2015 21:07:42 UTC-4, Dave S wrote: On Tuesday, April 28, 2015 at 6:01:04 PM UTC-7, Aydin S wrote: This is probably very simple, sorry in advance! I have a form defined in a model file: db.define_table('table1', Field('X', 'integer')) I have a controller that is also defined as: def index(): form = SQLFORM(db.X) return dict(form=form) In my index view file I have: h2Input form/h2 {{=form}} I want to use value X in a scheduler defined as a model like: A = X+2 The form shows up as expected. I enter a value in it and submit it. The scheduler is running as expected. However it looks like the value X never gets set to what I enter. Any idea? Do you process the form once the user has entered the input? /dps -- 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 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/d/optout.
[web2py] Re: Form to get a value and process
I double checked my scheduler and found out a problem and fixed; right now it is working as expected. Thanks for the help and guidance. On Wednesday, 29 April 2015 17:19:44 UTC-4, Aydin S wrote: Yes, I got it, thanks. There is one problem regarding scheduler though. In my controller I have: def index(): form = SQLFORM(db.Table1).process() P = db().select(db.Table1.X, orderby=~db.Table1.id, limitby=(0, 1)) row = P[0] final = row.X return dict(form=form, final=final) In the view this exactly show the value of the record which I wanted. Then in my scheduler I use final as follows: if final 10 do something This does not work. I have checked to see if my scheduler algorithm is correct and it is because I can enter 20 instead of final or 1 and things work as expected. My scheduler is defined in the models. I wonder what the problem is? Is it because my scheduler does not see final? I tried to make it global by (global final) but this also did not help. Thanks so much for the help On Wednesday, 29 April 2015 15:35:27 UTC-4, Anthony wrote: Note, this is all covered in the online documentation -- I suggest you skim through the chapter on the DAL: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer A select returns a Rows object. You must then extract an individual Row from it, and then the individual field value from the Row. In your case, you want: X[0].X Anthony On Wednesday, April 29, 2015 at 2:38:05 PM UTC-4, Aydin S wrote: Thanks Anthony, This works fine, I also added the field name because I want to get only the value of X, so I used: db(db.Table1).select(db.Table1.X, orderby=~db.Table1.id, limitby=(0, 1)) However, this does not return the value, I used: def index(): form = SQLFORM(db.Temp).process() X = db(db.Table1).select(db.Table1.X, orderby=~db.Table1.id, limitby=(0, 1)) return (form=form,X=X) Then I printed X in the view using {{=X}} which returns: Table1.X 10 As you see this is a column, what I want is the number 10 only. Sorry if this is so basic issue. On Wednesday, 29 April 2015 10:17:57 UTC-4, Anthony wrote: db.Table1.X is just a field object and doesn't refer to any record in the database. To retrieve a record, you must create a query. In most databases, you can just take the record with the largest ID: db(db.Table1).select(orderby=~db.Table1.id, limitby=(0, 1)) That sorts in reverse order based on ID and takes the first record. Alternatively, you could include a record creation timestamp and sort based on that. Anthony On Wednesday, April 29, 2015 at 9:31:50 AM UTC-4, Aydin S wrote: Thank you, you are right, right now I have: def index(): form = SQLFORM(db.X).process() return dict(form=form) and I see the database getting updated with new records. One last question, I use db.Table1.X to refer to the last entered record. However, this does not work. How can I make it use the last entered row? On Wednesday, 29 April 2015 08:27:22 UTC-4, Anthony wrote: See answer on SO: http://stackoverflow.com/a/29932995/440323 On Tuesday, April 28, 2015 at 9:35:31 PM UTC-4, Aydin S wrote: It looks like the scheduler which is a model file does not see variable X in the database! On Tuesday, 28 April 2015 21:19:14 UTC-4, Aydin S wrote: No, the value of the form gets processed every time the scheduler runs. On Tuesday, 28 April 2015 21:07:42 UTC-4, Dave S wrote: On Tuesday, April 28, 2015 at 6:01:04 PM UTC-7, Aydin S wrote: This is probably very simple, sorry in advance! I have a form defined in a model file: db.define_table('table1', Field('X', 'integer')) I have a controller that is also defined as: def index(): form = SQLFORM(db.X) return dict(form=form) In my index view file I have: h2Input form/h2 {{=form}} I want to use value X in a scheduler defined as a model like: A = X+2 The form shows up as expected. I enter a value in it and submit it. The scheduler is running as expected. However it looks like the value X never gets set to what I enter. Any idea? Do you process the form once the user has entered the input? /dps -- 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 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/d/optout.
[web2py] Re: Form to get a value and process
Thank you, you are right, right now I have: def index(): form = SQLFORM(db.X).process() return dict(form=form) and I see the database getting updated with new records. One last question, I use db.Table1.X to refer to the last entered record. However, this does not work. How can I make it use the last entered row? On Wednesday, 29 April 2015 08:27:22 UTC-4, Anthony wrote: See answer on SO: http://stackoverflow.com/a/29932995/440323 On Tuesday, April 28, 2015 at 9:35:31 PM UTC-4, Aydin S wrote: It looks like the scheduler which is a model file does not see variable X in the database! On Tuesday, 28 April 2015 21:19:14 UTC-4, Aydin S wrote: No, the value of the form gets processed every time the scheduler runs. On Tuesday, 28 April 2015 21:07:42 UTC-4, Dave S wrote: On Tuesday, April 28, 2015 at 6:01:04 PM UTC-7, Aydin S wrote: This is probably very simple, sorry in advance! I have a form defined in a model file: db.define_table('table1', Field('X', 'integer')) I have a controller that is also defined as: def index(): form = SQLFORM(db.X) return dict(form=form) In my index view file I have: h2Input form/h2 {{=form}} I want to use value X in a scheduler defined as a model like: A = X+2 The form shows up as expected. I enter a value in it and submit it. The scheduler is running as expected. However it looks like the value X never gets set to what I enter. Any idea? Do you process the form once the user has entered the input? /dps -- 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 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/d/optout.
[web2py] Re: Form to get a value and process
No, the value of the form gets processed every time the scheduler runs. On Tuesday, 28 April 2015 21:07:42 UTC-4, Dave S wrote: On Tuesday, April 28, 2015 at 6:01:04 PM UTC-7, Aydin S wrote: This is probably very simple, sorry in advance! I have a form defined in a model file: db.define_table('table1', Field('X', 'integer')) I have a controller that is also defined as: def index(): form = SQLFORM(db.X) return dict(form=form) In my index view file I have: h2Input form/h2 {{=form}} I want to use value X in a scheduler defined as a model like: A = X+2 The form shows up as expected. I enter a value in it and submit it. The scheduler is running as expected. However it looks like the value X never gets set to what I enter. Any idea? Do you process the form once the user has entered the input? /dps -- 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 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/d/optout.
[web2py] Form to get a value and process
This is probably very simple, sorry in advance! I have a form defined in a model file: db.define_table('table1', Field('X', 'integer')) I have a controller that is also defined as: def index(): form = SQLFORM(db.X) return dict(form=form) In my index view file I have: h2Input form/h2 {{=form}} I want to use value X in a scheduler defined as a model like: A = X+2 The form shows up as expected. I enter a value in it and submit it. The scheduler is running as expected. However it looks like the value X never gets set to what I enter. Any idea? -- 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 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/d/optout.
[web2py] Re: Form to get a value and process
It looks like the scheduler which is a model file does not see variable X in the database! On Tuesday, 28 April 2015 21:19:14 UTC-4, Aydin S wrote: No, the value of the form gets processed every time the scheduler runs. On Tuesday, 28 April 2015 21:07:42 UTC-4, Dave S wrote: On Tuesday, April 28, 2015 at 6:01:04 PM UTC-7, Aydin S wrote: This is probably very simple, sorry in advance! I have a form defined in a model file: db.define_table('table1', Field('X', 'integer')) I have a controller that is also defined as: def index(): form = SQLFORM(db.X) return dict(form=form) In my index view file I have: h2Input form/h2 {{=form}} I want to use value X in a scheduler defined as a model like: A = X+2 The form shows up as expected. I enter a value in it and submit it. The scheduler is running as expected. However it looks like the value X never gets set to what I enter. Any idea? Do you process the form once the user has entered the input? /dps -- 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 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/d/optout.
[web2py] ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.
I read the solutions for this error, could not resolve it. Before, I had the following code in the access.py deleted and everything worked fine. if request.is_https: session.secure() elif not request.is_local and not DEMO_MODE: raise HTTP(200, T('Admin is disabled because insecure channel')) Right now, I tried to upgrade to the new version of web2py that everything messed up and I get ATTENTION: Login requires a secure (HTTPS) connection or running on localhost. Since I'm running on 0.0.0.0 I understand I need to have https, I tried to generate the key and put it in the web2py root folder and run web2py using -k key.key -c key-ctr when I do that it even fails to bring the normal website up and gives error connection was reset. Any help? -- 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 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/d/optout.
[web2py] Scheduler on Debian (Beaglebone)
Hi, Upstart does not exist in the debian on beaglebone and i do not want to mess with that. There is a script developed in https://github.com/web2py/web2py/blob/master/scripts/setup-scheduler-centos.sh which uses chkconfig to add the service to the start up. chkconfig also does not exist in the debian. I tried to modify the script and use update-rc.d, however all the attempts failed. What ultimately I want to do is to run periodic tasks and any suggestion is welcome and appreciated. I know about Celery but I found Massimo's argument about scheduler convincing and wanted to use it. By the way, what are the main drawbacks of web2py cron? Should I try to use that? -- 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 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/d/optout.
[web2py] web2py on debian run on startup
I've installed web2py using sudo ./setup-web2py-ubuntu.sh on Debian (BBB) However, web2py does not start on startup. I did a test I did service web2py start, it did not start. In another test I did service web2py stop and then service web2py start and it worked. Does anyone have any idea what's going on? -- 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 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/d/optout.
[web2py] Error using update-rc.d trying to get web2py run on startup
I appreciate if anyone can help with the following issue: I'm trying to run web2py in startup on beaglebone (linux Debian). The problem is that it does not start on the boot; however when i do service web2py start, it starts and works. The reason I know it does not start on the boot is that because when I do netstat -tanp the web2py port is not occupied. Apache2 starts in the boot tho. Other test I did was to service --status-all and it shows (+) for web2py. The web2py in the /etc/init.d is setup and first lines of it are as follows: PATH=/usr/sbin:/usr/bin:/sbin:/bin DESC=Web Framework NAME=web2py PIDDIR=/var/run/$NAME PIDFILE=$PIDDIR/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME DAEMON=/usr/bin/python DAEMON_DIR=/home/www-data/$NAME DAEMON_ARGS=web2py.py -a pass2 -p 8084 -i 0.0.0.0 --pid_filename=$PIDFILE DAEMON_USER=root I changed Daemon_user from root to www-data (directory when web2py is installed) and it still did not start. One thing I noticed when doing sudo update-rc.d web2py defaults, I got the following: update-rc.d: using dependency based boot sequencing update-rc.d: warning: default stop runlevel arguments (0 1 6) do not match web2py Default-Stop values (S 0 1 6) insserv: warning: current stop runlevel(s) (0 1 6) of script `web2py' overrides LSB defaults (0 1 6 S). insserv: warning: script 'setup-web2py-ubuntu.sh' missing LSB tags and overrides I think there is a problem with this. Any help is appreciated. -- 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 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/d/optout.
[web2py] Re: Error while trying to run web2py in startup linux
I look at the journal: sudo[1519]: pam_unix(sudo:session): session closed for user root web2py[1597]: Starting Web Framework: web2pychown: invalid user: `web2py' web2py[1597]: start-stop-daemon: user 'web2py' not found web2py[1597]: failed! systemd[1]: web2py.service: control process exited, code=exited status=2 systemd[1]: Unit web2py.service entered failed state. Any idea what's going on? On Sunday, 1 February 2015 16:12:04 UTC-5, Aydin S wrote: Hi, I finally got to know that web2py is best to be used in the startup using system level configuration not as cron. I gave up running it from crontab because it didn't work. I read http://web2py.com/books/default/chapter/29/13#One-step-production-deployment and implemented what is said in three steps as follows: On Ubuntu, or other Debian-based Linux distribution, edit web2py.ubuntu.sh and replace the /usr/lib/web2py path with the path of your web2py installation, then type the following shell commands to move the file into the proper folder, register it as a startup service, and start it: sudo cp scripts/web2py.ubuntu.sh /etc/init.d/web2py sudo update-rc.d web2py defaults sudo /etc/init.d/web2py start I did change the path in the web2py.ubuntu.sh in line DAEMON_DIR=/path/$NAME; I did not touch other things in this file. Then I ran sudo cp scripts/web2py.ubuntu.sh /etc/init.d/web2py and it worked since it moved the file to the right place. Then I ran sudo update-rc.d web2py defaults and got the following: update-rc.d: using dependency based boot sequencing update-rc.d: warning: default stop runlevel arguments (0 1 6) do not match web2py Default-Stop values (S 0 1 6) insserv: script web2py is not an executable regular file, skipped! I gave executable access to web2py in /etc/init.d directory and this time I did not get the message insserv: script web2py is not an executable regular file, skipped!. finally, when I ran sudo /etc/init.d/web2py start, I got the following error: [] Starting web2py (via systemctl): web2py.serviceJob failed. See system journal and 'systemctl status' for details. failed! Any help is appreciated. -- 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 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/d/optout.
[web2py] Re: Run web2py in public IP without explicit IP address - linux
Thanks that was useful. On Friday, 30 January 2015 22:34:30 UTC-5, Massimo Di Pierro wrote: This should not be the case. http://stackoverflow.com/questions/20778771/what-is-the-difference-between-0-0-0-0-127-0-0-1-and-localhost On Friday, 30 January 2015 16:30:26 UTC-6, Aydin S wrote: Thanks for the reply. 0.0.0.0 makes the server run in 127.0.0.1 which is local and does not give me access to the website from other computer. sexta-feira, 30 de Janeiro de 2015 às 10:46:05 UTC-5, Niphlod escreveu: why don't you just use 0.0.0.0 ? On Friday, January 30, 2015 at 2:43:02 PM UTC+1, Aydin S wrote: Hi, i tried to run web2py from public IP in linux like this: web2py -i hostname -a pass It did not work. I realized it was due to using hostname; it works fine when doing web2py -i 192.168.0.0(for example) -a pass Is there any way to not enter the IP address every time? I know web2py itself reads the public IP,is there anyway to use it in the command options? Can this be done at all or needs source code modification? -- 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 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/d/optout.
Re: [web2py] Trying to run web2py from linux, all ports fail
Yes, I got it thanks. On Friday, 30 January 2015 09:16:51 UTC-5, Michele Comitini wrote: One trick that could somewhat accelerate the release of a port not properly closed by a server is trying to connect to it. for instance: nc 127.0.0.1 8000 and then CTRL-C the trick awakes the network layer that gives a Connection Refused and from then on the port is free again -- 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 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/d/optout.
[web2py] Error while trying to run web2py in startup linux
Hi, I finally got to know that web2py is best to be used in the startup using system level configuration not as cron. I gave up running it from crontab because it didn't work. I read http://web2py.com/books/default/chapter/29/13#One-step-production-deployment and implemented what is said in three steps as follows: On Ubuntu, or other Debian-based Linux distribution, edit web2py.ubuntu.sh and replace the /usr/lib/web2py path with the path of your web2py installation, then type the following shell commands to move the file into the proper folder, register it as a startup service, and start it: sudo cp scripts/web2py.ubuntu.sh /etc/init.d/web2py sudo update-rc.d web2py defaults sudo /etc/init.d/web2py start I did change the path in the web2py.ubuntu.sh in line DAEMON_DIR=/path/$NAME; I did not touch other things in this file. Then I ran sudo cp scripts/web2py.ubuntu.sh /etc/init.d/web2py and it worked since it moved the file to the right place. Then I ran sudo update-rc.d web2py defaults and got the following: update-rc.d: using dependency based boot sequencing update-rc.d: warning: default stop runlevel arguments (0 1 6) do not match web2py Default-Stop values (S 0 1 6) finally, when I ran sudo /etc/init.d/web2py start, I got the following error: [] Starting web2py (via systemctl): web2py.serviceJob failed. See system journal and 'systemctl status' for details. failed! Any help is appreciated. -- 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 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/d/optout.
[web2py] Why web2py does not run on startup using crontab
Hi, does anyone know why web2py does not run on startup using crantab? (linux machine) When I call web2py.py normally in terminal it works fine, python web2py.py. When I put the following command in the crantab it does not run. @reboot python /root/web2py.py I've tested to see if the crontab can run other python files and it can. I've read the group for possible solutions, I tried to enable -Y, -C and -J but no help. Any idea that can help? -- 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 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/d/optout.
[web2py] Re: Run web2py in public IP without explicit IP address - linux
Thanks for the reply. 0.0.0.0 makes the server run in 127.0.0.1 which is local and does not give me access to the website from other computer. sexta-feira, 30 de Janeiro de 2015 às 10:46:05 UTC-5, Niphlod escreveu: why don't you just use 0.0.0.0 ? On Friday, January 30, 2015 at 2:43:02 PM UTC+1, Aydin S wrote: Hi, i tried to run web2py from public IP in linux like this: web2py -i hostname -a pass It did not work. I realized it was due to using hostname; it works fine when doing web2py -i 192.168.0.0(for example) -a pass Is there any way to not enter the IP address every time? I know web2py itself reads the public IP,is there anyway to use it in the command options? Can this be done at all or needs source code modification? -- 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 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/d/optout.
Re: [web2py] Trying to run web2py from linux, all ports fail
I did a test, Mirko is right, in linux if web2py is not shut down right it cannot run on any port other than what it initially run with. Other thing was my own error, for public IP I was using -i hostname this did not work. When I put exact IP address number 192.168.0.0 it works. Now the question is, my IP is dynamic, is there any way to run web2py from public IP always without the need to enter the IP address? Web2py it self gets the IP address, is there anyway to use that? sexta-feira, 30 de Janeiro de 2015 às 08:14:48 UTC-5, Aydin S escreveu: I found out what makes the root cause and any suggestion to resolve this is very appreciated: If I run the web2py by local IP, it has no problem with any port. But, if I run the web2py from public IP of machine (192.168.0.0 for example) it gives the error above. And this is limited to linux, in windows it works fine with the public IP. Any idea what's going on? sexta-feira, 30 de Janeiro de 2015 às 08:06:26 UTC-5, Aydin S escreveu: Thanks for the replies. Mirko, do you mean I should wait for couple of minutes and run web2py and it will work? Michele, here is the results of the netstat -tanp PID/Program name tcp0 0 0.0.0.0:22 0.0.0.0:* LISTEN 832/sshd tcp0 0 127.0.0.1:3950 0.0.0.0:* LISTEN 819/xrdp-sesman tcp0 0 0.0.0.0:38890.0.0.0:* LISTEN 803/xrdp tcp0 0 192.168..0.0:20 192.168.0.0: ESTABLISHED 1144/0 tcp6 0 0 :::8080 :::* LISTEN 851/apache2 tcp6 0 0 :::80 :::* LISTEN 1/systemd tcp6 0 0 :::22 :::* LISTEN 832/sshd tcp6 0 0 :::3000 :::* LISTEN 1/systemd sexta-feira, 30 de Janeiro de 2015 às 03:15:55 UTC-5, Michele Comitini escreveu: as root do: # netstat -tanp and see what you get 2015-01-30 5:28 GMT+01:00 Mirko Scavazzin mscav...@gmail.com: *TIME_WAIT** is the state that typically ties up the port for several minutes after the process has completed.*The length of the associated timeout varies on different operating systems, and may be dynamic on some operating systems, however typical values are in the range of one to four minutes. HTH Le 30 janv. 2015 05:16, Aydin S hsof...@gmail.com a écrit : Hi, I'm trying to run web2py from linux. However, it fails with this error: ERROR:Rocket.Errors.Port8000:Socket hostname:8000 in use by other process and it won't share. WARNING:Rocket.Errors.Port8000:Listener started when not ready. I have tried various ports like 8001, and it fails still. There is no other process using these ports. By the way, this does not happen in windows. I searched in the group for this problem and saw some posts but no help from those. Any help or advice is appreciated. -- 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 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/d/optout. -- 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 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/d/optout. -- 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 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/d/optout.
[web2py] Run web2py in public IP without explicit IP address - linux
Hi, i tried to run web2py from public IP in linux like this: web2py -i hostname -a pass It did not work. I realized it was due to using hostname; it works fine when doing web2py -i 192.168.0.0(for example) -a pass Is there any way to not enter the IP address every time? I know web2py itself reads the public IP,is there anyway to use it in the command options? Can this be done at all or needs source code modification? -- 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 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/d/optout.
Re: [web2py] Trying to run web2py from linux, all ports fail
Thanks for the replies. Mirko, do you mean I should wait for couple of minutes and run web2py and it will work? Michele, here is the results of the netstat -tanp PID/Program name tcp0 0 0.0.0.0:22 0.0.0.0:* LISTEN 832/sshd tcp0 0 127.0.0.1:3950 0.0.0.0:* LISTEN 819/xrdp-sesman tcp0 0 0.0.0.0:38890.0.0.0:* LISTEN 803/xrdp tcp0 0 192.168..0.0:20 192.168.0.0: ESTABLISHED 1144/0 tcp6 0 0 :::8080 :::*LISTEN 851/apache2 tcp6 0 0 :::80 :::*LISTEN 1/systemd tcp6 0 0 :::22 :::*LISTEN 832/sshd tcp6 0 0 :::3000 :::*LISTEN 1/systemd sexta-feira, 30 de Janeiro de 2015 às 03:15:55 UTC-5, Michele Comitini escreveu: as root do: # netstat -tanp and see what you get 2015-01-30 5:28 GMT+01:00 Mirko Scavazzin mscav...@gmail.com javascript:: *TIME_WAIT** is the state that typically ties up the port for several minutes after the process has completed.*The length of the associated timeout varies on different operating systems, and may be dynamic on some operating systems, however typical values are in the range of one to four minutes. HTH Le 30 janv. 2015 05:16, Aydin S hsof...@gmail.com javascript: a écrit : Hi, I'm trying to run web2py from linux. However, it fails with this error: ERROR:Rocket.Errors.Port8000:Socket hostname:8000 in use by other process and it won't share. WARNING:Rocket.Errors.Port8000:Listener started when not ready. I have tried various ports like 8001, and it fails still. There is no other process using these ports. By the way, this does not happen in windows. I searched in the group for this problem and saw some posts but no help from those. Any help or advice is appreciated. -- 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 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 javascript:. For more options, visit https://groups.google.com/d/optout. -- 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 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 javascript:. For more options, visit https://groups.google.com/d/optout. -- 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 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/d/optout.
Re: [web2py] Trying to run web2py from linux, all ports fail
I found out what makes the root cause and any suggestion to resolve this is very appreciated: If I run the web2py by local IP, it has no problem with any port. But, if I run the web2py from public IP of machine (192.168.0.0 for example) it gives the error above. And this is limited to linux, in windows it works fine with the public IP. Any idea what's going on? sexta-feira, 30 de Janeiro de 2015 às 08:06:26 UTC-5, Aydin S escreveu: Thanks for the replies. Mirko, do you mean I should wait for couple of minutes and run web2py and it will work? Michele, here is the results of the netstat -tanp PID/Program name tcp0 0 0.0.0.0:22 0.0.0.0:* LISTEN 832/sshd tcp0 0 127.0.0.1:3950 0.0.0.0:* LISTEN 819/xrdp-sesman tcp0 0 0.0.0.0:38890.0.0.0:* LISTEN 803/xrdp tcp0 0 192.168..0.0:20 192.168.0.0: ESTABLISHED 1144/0 tcp6 0 0 :::8080 :::*LISTEN 851/apache2 tcp6 0 0 :::80 :::*LISTEN 1/systemd tcp6 0 0 :::22 :::*LISTEN 832/sshd tcp6 0 0 :::3000 :::*LISTEN 1/systemd sexta-feira, 30 de Janeiro de 2015 às 03:15:55 UTC-5, Michele Comitini escreveu: as root do: # netstat -tanp and see what you get 2015-01-30 5:28 GMT+01:00 Mirko Scavazzin mscav...@gmail.com: *TIME_WAIT** is the state that typically ties up the port for several minutes after the process has completed.*The length of the associated timeout varies on different operating systems, and may be dynamic on some operating systems, however typical values are in the range of one to four minutes. HTH Le 30 janv. 2015 05:16, Aydin S hsof...@gmail.com a écrit : Hi, I'm trying to run web2py from linux. However, it fails with this error: ERROR:Rocket.Errors.Port8000:Socket hostname:8000 in use by other process and it won't share. WARNING:Rocket.Errors.Port8000:Listener started when not ready. I have tried various ports like 8001, and it fails still. There is no other process using these ports. By the way, this does not happen in windows. I searched in the group for this problem and saw some posts but no help from those. Any help or advice is appreciated. -- 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 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/d/optout. -- 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 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/d/optout. -- 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 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/d/optout.
[web2py] Modify source to run web2py server with a pre-selected server IP
Hi, how to run web2py without a need to specify the IP? Running machine is linux. I know how to modify the file widget.py to eleminate the need for password, but I'm stuck to get it work with an pre-selected IP, meaning that to get web2py server to run from public IP always and not to ask me to select it. Any advice, comment or help is appreciated. -- 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 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/d/optout.
[web2py] Re: Modify source to run web2py server with a pre-selected server IP
Thanks so much for the very useful and precise answer. I understood, however, what I meant with public IP was not 0.0.0.0, I mean public IP assigned to my machine. I don't want to every time check it to see what it is because it is dynamic and I want to be able to use web2py's ability to read it. I want it always select this IP (192.168.1.000 for example) and start the server. Thanks so much my problem with password is solved. by the way, my ultimate goal from this is to be able to access the web2py app from two machines connected through my router. I think this needs some modification in the widget, don't you think so? quinta-feira, 29 de Janeiro de 2015 às 15:22:50 UTC-5, Niphlod escreveu: web2py.py has 2 useful parameters: -i and -p. Respectively, they make the application listen on the address specified after -i and at the port specified with -p. To avoid the widget from popping up, you should also pass the -a parameter to supply a password. Special bonuses: there is a special value to pass to the -i option that makes web2py listen on all possible network interfaces (0.0.0.0) and a special value to pass to the -a option to keep the last password set (recycle). Summarizing, try to start the first time web2py with web2py.py -i 0.0.0.0 -p 8000 -a mypassword replacing the red part with your own password... then kill the process (or hit ctrl+c to let it terminate). From now on, you can start web2py simply issuing web2py.py -i 0.0.0.0 -p 8000 -a 'recycle' and web2py won't ask for a single thing. BTW: all commandline options are documented here http://web2py.com/books/default/chapter/29/04/the-core#Command-line-options On Thursday, January 29, 2015 at 3:51:36 PM UTC+1, Aydin S wrote: Hi, how to run web2py without a need to specify the IP? Running machine is linux. I know how to modify the file widget.py to eleminate the need for password, but I'm stuck to get it work with an pre-selected IP, meaning that to get web2py server to run from public IP always and not to ask me to select it. Any advice, comment or help is appreciated. -- 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 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/d/optout.
[web2py] Trying to run web2py from linux, all ports fail
Hi, I'm trying to run web2py from linux. However, it fails with this error: ERROR:Rocket.Errors.Port8000:Socket hostname:8000 in use by other process and it won't share. WARNING:Rocket.Errors.Port8000:Listener started when not ready. I have tried various ports like 8001, and it fails still. There is no other process using these ports. By the way, this does not happen in windows. I searched in the group for this problem and saw some posts but no help from those. Any help or advice is appreciated. -- 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 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/d/optout.
[web2py] Re: Modify source to run web2py server with a pre-selected server IP
I found it out. Just used the hostname after -i. quinta-feira, 29 de Janeiro de 2015 às 21:33:08 UTC-5, Aydin S escreveu: Thanks so much for the very useful and precise answer. I understood, however, what I meant with public IP was not 0.0.0.0, I mean public IP assigned to my machine. I don't want to every time check it to see what it is because it is dynamic and I want to be able to use web2py's ability to read it. I want it always select this IP (192.168.1.000 for example) and start the server. Thanks so much my problem with password is solved. by the way, my ultimate goal from this is to be able to access the web2py app from two machines connected through my router. I think this needs some modification in the widget, don't you think so? quinta-feira, 29 de Janeiro de 2015 às 15:22:50 UTC-5, Niphlod escreveu: web2py.py has 2 useful parameters: -i and -p. Respectively, they make the application listen on the address specified after -i and at the port specified with -p. To avoid the widget from popping up, you should also pass the -a parameter to supply a password. Special bonuses: there is a special value to pass to the -i option that makes web2py listen on all possible network interfaces (0.0.0.0) and a special value to pass to the -a option to keep the last password set (recycle). Summarizing, try to start the first time web2py with web2py.py -i 0.0.0.0 -p 8000 -a mypassword replacing the red part with your own password... then kill the process (or hit ctrl+c to let it terminate). From now on, you can start web2py simply issuing web2py.py -i 0.0.0.0 -p 8000 -a 'recycle' and web2py won't ask for a single thing. BTW: all commandline options are documented here http://web2py.com/books/default/chapter/29/04/the-core#Command-line-options On Thursday, January 29, 2015 at 3:51:36 PM UTC+1, Aydin S wrote: Hi, how to run web2py without a need to specify the IP? Running machine is linux. I know how to modify the file widget.py to eleminate the need for password, but I'm stuck to get it work with an pre-selected IP, meaning that to get web2py server to run from public IP always and not to ask me to select it. Any advice, comment or help is appreciated. -- 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 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/d/optout.
[web2py] show title and some text of a link
How can title and some text of a link be displayed under it? For example, if a link is posted to the website, it can show the title and some of the first characters in its body. Take a news link for 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: show title and some text of a link
Yes, what I meant was a link to an external site On Monday, September 2, 2013 2:15:21 PM UTC-4, LightDot wrote: If it's a link to an external site, you'll have to either scrape the site to get the beginning of the content, or the link submitter will have to enter it when the link is entered. For scraping, look into the http://docs.python-requests.org/en/latest/(requests library) and go from there. Regards, Ales On Monday, September 2, 2013 7:41:57 PM UTC+2, Aydin S wrote: How can title and some text of a link be displayed under it? For example, if a link is posted to the website, it can show the title and some of the first characters in its body. Take a news link for 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] Customizing login form
I am trying to customize the location and appearance of the login form. I am looking for the easiest way to do this. I am using return dict(login=auth.login()) in my default.py and {{=login} in my html. I have tried couple of things posted in here, but I found them vague and not quite understandable and non worked. for instance using {{=XML(form.custom.begin. replace('', ' class=myclass'))}}, my question is where this code goes to? to the html file? Where and how to define myclass? and what is the replace? How to end this? any simple example code would be so helpful. -- --- 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.