Re: [web2py] Python Performance Issue, Part 2

2014-03-22 Thread horridohobbyist
I don't understand why the Flask version of the Welcome test doesn't exhibit this slowdown under Apache. It's executing the same application code. It's configured with the same "processes=1" and "threads=1" WSGI parameters. It's running the same Python interpreter (and presumably using the same

[web2py] Re: cannot import module from application's modules directory on pythonanywhere.com

2014-03-22 Thread 黄祥
is it running well in your local computer? or maybe try to import module like : import *chord* def index(): return *chord*.function_name_on_module_chord(function_argument_if_any) best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.

[web2py] Re: functional test

2014-03-22 Thread 黄祥
thank you so much for your hint, massimo, it works well now. something like : *modules/functional_test.py* import sys; sys.path.append('../../../') the_rest_same_like_on_the_book thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http:/

Re: [web2py] Re: 2.9.5-stable Version throws ticket when /admin accessed [CLOSED]

2014-03-22 Thread weheh
@Niphlod: LOL. That's the same conclusion I came to in about 5 minutes. I rejiggered things and am sticking with subprocess module. Unfortunately, the damage was already done to my web2py setup. The silver lining to all this is I think I figured out how to get to python 2.7.x, so not all was a

[web2py] cannot import module from application's modules directory on pythonanywhere.com

2014-03-22 Thread stefaan
I have a copy of the music21 python library in the modules folder of my application. >From the pythonanywhere bash prompt I can import it without problems: cd ~/web2py/applications/mints/modules python >>> from music21 import chord >>> chord When I tried to import it from my application, at fi

Re: [web2py] Re: New python.org layout

2014-03-22 Thread Mariano Reingart
Great news: We are now listed in https://www.python.org/ Congrats and thanks to the maintainers added it and that closed the ticket! Best regards Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com -- Resources: - http://web2py.com - http://web2py.com/book (Document

Re: [web2py] Re: New python.org layout

2014-03-22 Thread Mariano Reingart
Not only susy, there seems to be even ruby code files inside the pythondotorg repository. In fact, all the "chef" directory (find -name "*.rb" | wc) counts 116 files (seems to be a kind of deployment automation) Susy is called in /settings/pipeline.py: PIPELINE_SASS_ARGUMENTS = '--quiet --compas

Re: [web2py] Python Performance Issue, Part 2

2014-03-22 Thread horridohobbyist
I'm considering delving into DTrace to find out what's going on, but any such instrumentation is apparently very problematic in Linux (eg, poor support, poor documentation, etc.). Is there any other way to find out what the hell is going on? On Saturday, 22 March 2014 16:24:20 UTC-4, horridoho

Re: [web2py] Re: New python.org layout

2014-03-22 Thread Michele Comitini
seems they need ruby because of this: https://github.com/ericam/susy *embarassing* 2014-03-22 19:08 GMT+01:00 Massimo Di Pierro : > Are you telling me that the new python.org requires ruby? > > Massimo > > On Saturday, 22 March 2014 12:14:58 UTC-5, Mariano Reingart wrote: >> >> On Sat, Mar 22, 2

Re: [web2py] Python Performance Issue, Part 2

2014-03-22 Thread horridohobbyist
Well, according to the 'free' command, even when I'm getting these slowdowns, I'm nowhere close to the memory limits: total used free shared buffers cached Mem: 39252443929003532344 0 23608 123856 Like I said, my Linux server doesn't

[web2py] Re: Login form adittional fields

2014-03-22 Thread xgp . latino
Hi Leonel, I need to authenticate 3 fields instead if usual 2. Because i need to used identification number and type of identification document and the usual password to login. Gonna try login_bare. Thanks. El viernes, 21 de marzo de 2014 22:51:21 UTC-5, Leonel Câmara escribió: > > I don't g

[web2py] Re: Creating a background task script on models, db is not defined.

2014-03-22 Thread Avi A
Same. /models/z_import_catalog.py", line 13, in item = db(db.t_items.unfi_product == row[5]).select().first() NameError: name 'db' is not defined On Saturday, March 22, 2014 9:20:03 PM UTC+2, Niphlod wrote: > > try calling it z_whatever.py and see. > > On Saturday, March 22, 2014 3:34:48 P

Re: [web2py] Nginx + Web2py

2014-03-22 Thread Federico Ferraro
I solved compiling admin app with python 2.6 : python26 -c "import gluon.compileapp; gluon.compileapp.compile_application('applications/admin')" Thanks .. 2014-03-22 6:15 GMT-03:00 Michele Comitini : > seems a problem of python version. > if the app is not compiled you can try removing old .p

[web2py] Re: Creating a background task script on models, db is not defined.

2014-03-22 Thread Niphlod
try calling it z_whatever.py and see. On Saturday, March 22, 2014 3:34:48 PM UTC+1, Avi A wrote: > > Sorry, I'm still getting the same error. > I called that file: > db_wizard_catalog_insert.py , so it's located after the db_wizard.py and I > just run the file. > Is that what you meant? > > On S

Re: [web2py] Re: 2.9.5-stable Version throws ticket when /admin accessed [CLOSED]

2014-03-22 Thread Niphlod
BTW: working with multiprocessing (backported) in python 2.5 is a nightmare. On Saturday, March 22, 2014 4:20:20 PM UTC+1, weheh wrote: > > OK, the emergency is over! Thanks all for your suggestions. > > The solution was for me to go further back in time and copy an older > backup of admin into p

Re: [web2py] Re: New python.org layout

2014-03-22 Thread Ovidio Marinho
It was better to have done with web2py. Ovidio Marinho Falcao Neto ITJP.NET.BR ovidio...@gmail.com itjp.net...@gmail.com Brasil 2014-03-22 15:08 GMT-03:00 Massimo Di Pierro : > Are you telling me that the new pyth

Re: [web2py] Re: New python.org layout

2014-03-22 Thread Massimo Di Pierro
Are you telling me that the new python.org requires ruby? Massimo On Saturday, 22 March 2014 12:14:58 UTC-5, Mariano Reingart wrote: > > On Sat, Mar 22, 2014 at 11:21 AM, Mariano Reingart > > > wrote: > >> On Sat, Mar 22, 2014 at 10:54 AM, Mariano Reingart >> >> > wrote: >> >>> On Sat, Mar 22

[web2py] Re: functional test

2014-03-22 Thread Massimo Di Pierro
I see. than there are two issues: 1) do not put test.py in the controllers folder else it is exposed put it in application/modules/ 2) it is not finding gluon. At the top of the file do: import sys; sys.path.append('/path/to/web2py') On Saturday, 22 March 2014 12:23:51 UTC-5, 黄祥 wrote: > > i'm

Re: [web2py] Re: New python.org layout

2014-03-22 Thread Michele Comitini
@Mariano, the pip has the --user option for install command: pip install --user ... so no need to install system wide, but still I too do not understand why they do not go in the virtualenv 2014-03-22 18:14 GMT+01:00 Mariano Reingart : > On Sat, Mar 22, 2014 at 11:21 AM, Mariano Reingart > wro

[web2py] Re: functional test

2014-03-22 Thread 黄祥
i'm sorry forgot to tell that i'm using web2py source (latest version) with python 2.7.6 installed on windows 7 home premium 64 bit. the step i took for that are : - run web2py.py - create new application name test - create test.py in controllers folder with the content i copas (copy paste) from

[web2py] Re: test post

2014-03-22 Thread Daniel McBrearty
no problems. Actually I saw that posts were subject to approval and assumed it was awaitng. Then solved the issue myself anyway :-) so maybe google is even scarily smarter than we think ... ! On Thursday, 20 March 2014 10:21:38 UTC+1, Daniel McBrearty wrote: > > excuse me - my last post seems

[web2py] New to Web2py - Runestone database issues

2014-03-22 Thread David Hale
Hey, I'm completely new to web2py and I am currently trying to install/run Runestone on it. I've followed the specific instructions given to me by runestone up to the point where it says to modify the database if you get an error. I'm

Re: [web2py] Python Performance Issue, Part 2

2014-03-22 Thread Massimo Di Pierro
Have you checked memory consumption? On Saturday, 22 March 2014 10:15:59 UTC-5, horridohobbyist wrote: > > Scratch my solution. It's not correct. My test results are all over the > place. You don't even have to wait an hour. Within the span of 15 minutes, > I've gone from fast, fast, fast, fast,

[web2py] Re: functional test

2014-03-22 Thread Massimo Di Pierro
You should be using the web2py source distribution is you plan to use your own version of python. On Saturday, 22 March 2014 07:13:04 UTC-5, 黄祥 wrote: > > hi, > > i want to learn about functional testing base on the book, but when i > create and run it it return an error : > > C:\web2py\applica

Re: [web2py] Re: 2.9.5-stable Version throws ticket when /admin accessed [CLOSED]

2014-03-22 Thread weheh
OK, the emergency is over! Thanks all for your suggestions. The solution was for me to go further back in time and copy an older backup of admin into place, so admin is working again. Next exercise is to try to climb up to 2.7.X, but as I said, I'm held back by this old module I didn't write.

Re: [web2py] Python Performance Issue, Part 2

2014-03-22 Thread horridohobbyist
Scratch my solution. It's not correct. My test results are all over the place. You don't even have to wait an hour. Within the span of 15 minutes, I've gone from fast, fast, fast, fast, fast, fast to super-slow (90+ seconds), super-slow to slow, slow, slow, slow. The variability seems to be pse

Re: [web2py] Python Performance Issue, Part 2

2014-03-22 Thread horridohobbyist
Something very strange is going on. After I've run the Welcome test where the results are consistently fast (ie, ~1.6 seconds), if I wait an hour or so and run the test again, I get something like the following: Begin... Elapsed time: 97.1873888969 Percentage fill: 41.9664268585 Begin... Elapsed

[web2py] Re: Creating a background task script on models, db is not defined.

2014-03-22 Thread Avi A
Sorry, I'm still getting the same error. I called that file: db_wizard_catalog_insert.py , so it's located after the db_wizard.py and I just run the file. Is that what you meant? On Saturday, March 22, 2014 4:05:03 PM UTC+2, Avi A wrote: > > Yes I tried that too, it didn't help. but now for some

Re: [web2py] Re: New python.org layout

2014-03-22 Thread Mariano Reingart
On Sat, Mar 22, 2014 at 10:54 AM, Mariano Reingart wrote: > On Sat, Mar 22, 2014 at 9:26 AM, Stefaan Himpe wrote: > >> Michele Comitini wrote: >> >>> Seems that the new layout of python.org is here: http://python.org >>> >> >> My first impression: it feels too widely spaced for my smaller laptop

[web2py] Re: Creating a background task script on models, db is not defined.

2014-03-22 Thread Avi A
Yes I tried that too, it didn't help. but now for some reason I'm not getting the error any longer. Thanks. On Saturday, March 22, 2014 3:12:32 PM UTC+2, Niphlod wrote: > > make sure the model is run AFTER the one holding the db > definition.models are executed alphabetically. > > On Fri

Re: [web2py] Re: 2.9.5-stable Version throws ticket when /admin accessed - dead in water

2014-03-22 Thread weheh
Sorry, I may have not have gotten the most recent ticket traceback. It is now this: S'Traceback (most recent call last):\n File "I:\\web2py\\gluon\\restricted.py", line 212, in restricted\nexec ccode in environment\n File "I:\\web2py\\applications\\admin\\controllers/default.py", line 16

Re: [web2py] Re: New python.org layout

2014-03-22 Thread Mariano Reingart
On Sat, Mar 22, 2014 at 9:26 AM, Stefaan Himpe wrote: > Michele Comitini wrote: > >> Seems that the new layout of python.org is here: http://python.org >> > > My first impression: it feels too widely spaced for my smaller laptop > screen. Their "community" menu runs off my screen (unless I go ful

Re: [web2py] Re: 2.9.5-stable Version throws ticket when /admin accessed - dead in water

2014-03-22 Thread weheh
@Niphlod: I had just found the from __future__ import with_statement in a stack overflow thread. I tried it out and now it seems the problem moves downstream. I'm still getting the endless ticket, but when I pick out the traceback, it looks like this: S'Traceback (most recent call last):\n Fil

[web2py] Re: Scheduler Task

2014-03-22 Thread Niphlod
this was discussed at length and now in 2.9.x there's a prevent_drift parameter that will make your tasks start at the same time. Unfortunately there's no mention of it in the changelog but its yet in the book http://web2py.com/books/default/chapter/29/04/the-core?search=prevent_drift On Friday

Re: [web2py] Re: list reference with ondelete=set null breaking when delete parent

2014-03-22 Thread Niphlod
you're all forgetting that: - relational database do have FK working - sqlite is not properly relational in matters of FK, unless you're working with a recent app (foreign key support was introduced by default in a recent release) and a fresh database - list:reference is not something baked in th

[web2py] Re: before_update callback and sheduler

2014-03-22 Thread Niphlod
if it happens in web2py's code, it will also in scheduler's environment. Please post a minimal app to reproduce the behaviour if it's repeatable On Friday, March 21, 2014 7:07:38 PM UTC+1, Carlos Cesar Caballero Díaz wrote: > > I have a _before_update callback, and it works when I update a recor

[web2py] Re: Creating a background task script on models, db is not defined.

2014-03-22 Thread Niphlod
http://web2py.com/books/default/chapter/29/04/the-core#Accessing-the-API-from-Python-modules On Friday, March 21, 2014 9:28:14 PM UTC+1, Avi A wrote: > > Hi, > I'm trying to create a background job/function. I'm locating the file on > the models directory, as I read on the book. > When I try to r

[web2py] MENU helper does not add active class

2014-03-22 Thread Ruud Schroen
Hi, I'm using the web2py MENU helper, but whenever i visit a page, the MENU helper does not add a active class to the li.. In the view: {{=MENU(response.menu,_id='navigation')}} In the model: submenu=[] response.menu = [(T('Home'), False, URL('default','index'), submenu)] response.menu.append

Re: [web2py] Re: 2.9.5-stable Version throws ticket when /admin accessed - dead in water

2014-03-22 Thread Niphlod
@weheh: try to edit admin/controllers/default.py putting from __future__ import with_statement at the top On Saturday, March 22, 2014 1:42:38 PM UTC+1, Niphlod wrote: > > I've always been the one pushing for dropping support for 2.4-2.5, and I > got back always "no, we'll keep 2.5". > > Seems

Re: [web2py] Re: 2.9.5-stable Version throws ticket when /admin accessed - dead in water

2014-03-22 Thread Niphlod
I've always been the one pushing for dropping support for 2.4-2.5, and I got back always "no, we'll keep 2.5". Seems that without any official statement we're dropping support for 2.5, due to https://github.com/web2py/web2py/blob/master/applications/admin/controllers/default.py#L807 On Saturda

[web2py] Re: New python.org layout

2014-03-22 Thread Stefaan Himpe
Michele Comitini wrote: Seems that the new layout of python.org is here: http://python.org My first impression: it feels too widely spaced for my smaller laptop screen. Their "community" menu runs off my screen (unless I go full-screen in my browser, which I normally never do). Although th

Re: [web2py] Re: 2.9.5-stable Version throws ticket when /admin accessed - dead in water

2014-03-22 Thread weheh
Michele - Thanks for the suggestions. Moving to python 2.7 opens another can of worms because of a module I'm using that isn't ported to 2.7. So that test must wait until very last. However, I did remove .pyc all around, but still no go -- same problem. On Saturday, March 22, 2014 5:11:42 PM UT

[web2py] functional test

2014-03-22 Thread 黄祥
hi, i want to learn about functional testing base on the book, but when i create and run it it return an error : C:\web2py\applications\test\controllers>python test.py Traceback (most recent call last): File "test.py", line 1, in from gluon.contrib.webclient import WebClient ImportError:

[web2py] Re: Create iOS, Android(.apk) clients for your web2py apps in minutes with this

2014-03-22 Thread 黄祥
please take a look at this discussion : https://groups.google.com/forum/#!msg/web2py/ajfU4UurfZE/YBrqzAEHNfAJ 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/

[web2py] Create iOS, Android(.apk) clients for your web2py apps in minutes with this

2014-03-22 Thread sasogeek
What do you mean by consumes your web2py services? Is there such a platform that simply packages a fully built web2py app into an android app? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/w

[web2py] Re: Invert select orderby

2014-03-22 Thread Annet
Hi, To sort in reverse order you add a tilde to db.image.date orderby=~db.image.date Kind regards, Annet -- 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) -

[web2py] New python.org layout

2014-03-22 Thread Michele Comitini
Seems that the new layout of python.org is here: http://python.org I see they keep "forgetting" to mention web2py as a web framework :-) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/

Re: [web2py] Nginx + Web2py

2014-03-22 Thread Michele Comitini
seems a problem of python version. if the app is not compiled you can try removing old .pyc floating around find web2py -type f -name '*.pyc' -exec rm -v {} + ; 2014-03-21 21:41 GMT+01:00 Anthony : > Did you try re-recompiling the app? > > -- > Resources: > - http://web2py.com > - http://web2py

Re: [web2py] Re: 2.9.5-stable Version throws ticket when /admin accessed - dead in water

2014-03-22 Thread Michele Comitini
Did you try using python 2.7? Did you try removing all .pyc around? find web2py -type f -name '*.pyc' -exec rm -v {} + ; 2014-03-22 9:54 GMT+01:00 weheh : > The problem clearly has to do with python not recognizing the "with" > statement. I tried retrieving an older version of /admin followed by

[web2py] Re: 2.9.5-stable Version throws ticket when /admin accessed - dead in water

2014-03-22 Thread weheh
The problem clearly has to do with python not recognizing the "with" statement. I tried retrieving an older version of /admin followed by a complete clean wipe and then re-install of python 2.5.4. The problem persists. Not sure what to do next. Any suggestions? -- Resources: - http://web2py.c

[web2py] Invert select orderby

2014-03-22 Thread Iuri Guilherme dos Santos Martins
I was trying to order the result of a sqlite select by date, but with an inverted order. I was hoping to access the SQLITE ORDER BY "ASC/DESC" like when I use direct SQL syntax, by means of the db().select() but I couldn't understand the specific syntax needed to acheive this. Current syntax

[web2py] Re: list:string type field output format

2014-03-22 Thread Pedro Pisandelli
Hi Antony! This made too many things clear to me. I got the point about "represent" function, but i guess the DIV(db...represent(...)) must be at a view file... and what about appadmin? Trying to get the fields value through appadmin, I got the error "*sequence item 0: expected string, long foun

Re: [web2py] Re: Problems with the server stalling out. Setting up debuging.

2014-03-22 Thread Gary Climacosa
Thanks we are also planning to migrate to nginx. On Saturday, March 22, 2014, Encompass solutions wrote: > The issue was fixed. Sorry for not seeing the follow up. I switched to > NGIX and everything works perfectly. Haven't seen this issue since. > BR, > Jason Brower > > On Sunday, February