Re: [web2py] Re: Python Performance Issue

2014-03-17 Thread Michele Comitini
@Massiom, @hb > python anyserver.py -s gunicorn -i 127.0.0.1 -p 8000 with the above just one worker is started, hence requests are serialized. 2014-03-17 1:03 GMT+01:00 Massimo Di Pierro : > easy_install gunicorn > cd web2py > python anyserver.py -s gunicorn -i 127.0.0.1 -p 8000 > > Anyway, yo

Re: [web2py] Pulling data every 30s for a ticker with web2py

2014-03-17 Thread António Ramos
does this help? http://vimeo.com/27478796 2014-03-16 17:48 GMT+00:00 Martin : > Hi all, > Please could anyone help me out, I need to pull some data from some API > (ex: https//xxx/aaa/ etc.) every 30s and then display the result in a ti > cker > How do I do this with Web2py + JavaScript ? I am

Re: [web2py] Re: Python Performance Issue

2014-03-17 Thread horridohobbyist
Parallels VM running on a 2.5GHz dual-core Mac mini. I really don't know what Parallels uses. On Monday, 17 March 2014 00:05:58 UTC-4, Massimo Di Pierro wrote: > > What kind of VM is this? What is the host platform? How many CPU cores? Is > VM using all the cores? The only thing I can think of

[web2py] How to automatically add referenced row during insert with SQLFORM.grid

2014-03-17 Thread Saifuddin Rangwala
I have 2 tables: db.define_table('category', Field('name', 'string'), ... format='%(name)s' ) db.define_table('idata', Field('description', 'string'), ... Field('category', db.category)

[web2py] Collpase folders view section

2014-03-17 Thread Annet
I am working on templates for my application. I have a folder 'templates' which contains a folder for every template, these folders contain 12 views per template. With 5 templates ready the view section of my application is cluttered by 60 views. To solve this problem I wonder whether it is poss

Re: [web2py] Re: Python Performance Issue

2014-03-17 Thread Cliff Kachinske
Apparently the number of cores is adjustable. Try this link. http://download.parallels.com/desktop/v5/docs/en/Parallels_Desktop_Users_Guide/23076.htm On Monday, March 17, 2014 10:02:13 AM UTC-4, horridohobbyist wrote: > > Parallels VM running on a 2.5GHz dual-core Mac mini. I really don't know >

Re: [web2py] Re: Python Performance Issue

2014-03-17 Thread horridohobbyist
Anyway, I ran the shipping code Welcome test with both Apache2 and Gunicorn. Here are the results: Apache:Begin... Apache:Elapsed time: 0.28248500824 Apache:Elapsed time: 0.805250167847 Apache:Percentage fill: 60.0 Apache:Begin... Apache:Elapsed time: 0.284092903137 Apache:Elapsed time: 0.7975358

[web2py] Re: Collpase folders view section

2014-03-17 Thread Massimo Di Pierro
Yes. simply you need to specify in controllers: def index(): response.view = 'path-to-my-view/index.html' where path is relative to the views folder. On Monday, 17 March 2014 10:49:32 UTC-5, Annet wrote: > > I am working on templates for my application. I have a folder 'templates' > which c

Re: [web2py] Re: Python Performance Issue

2014-03-17 Thread Massimo Di Pierro
very interesting. What is code being benchmarked here? could you post your apache configuration? On Monday, 17 March 2014 11:08:53 UTC-5, horridohobbyist wrote: > > Anyway, I ran the shipping code Welcome test with both Apache2 and > Gunicorn. Here are the results: > > Apache:Begin... > Apache:El

Re: [web2py] Re: Python Performance Issue

2014-03-17 Thread horridohobbyist
I bumped up the number of processors from 1 to 4. Here are the results: Apache:Begin... Apache:Elapsed time: 2.31899785995 Apache:Elapsed time: 6.31404495239 Apache:Percentage fill: 60.0 Apache:Begin... Apache:Elapsed time: 0.274327039719 Apache:Elapsed time: 0.832695960999 Apache:Percentage fill:

[web2py] LDAP auth and user_groups

2014-03-17 Thread Thomas Bellembois
Hello, Is there any way to use LDAP authentication for users and create user groups ? Apparently the get_or_create_user() method does not create them when the user comes from LDAP. Thanks, Thomas -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/we

Re: [web2py] LDAP auth and user_groups

2014-03-17 Thread Richard Vézina
You can fix it and propose a patch!! Richard On Mon, Mar 17, 2014 at 12:34 PM, Thomas Bellembois < thomas.bellemb...@gmail.com> wrote: > Hello, > > Is there any way to use LDAP authentication for users and create user > groups ? > > Apparently the get_or_create_user() method does not create the

Re: [web2py] LDAP auth and user_groups

2014-03-17 Thread Thomas Bellembois
I wanted to be sure that it is not an expected behavior. gluon/tools.py (line 1958) if user: ... elif checks: ... if self.user_group(user_id=user.id) is None: user_id = user.id if self.settings.create_user_groups: group_id = self.add_group( self.settings.c

Re: [web2py] Python Performance Issue

2014-03-17 Thread Ricardo Pedroso
On Thu, Mar 13, 2014 at 7:48 PM, horridohobbyist wrote: I have a rather peculiar Python performance issue with web2py. I'm using > pyShipping 1.8a (from http://pydoc.net/Python/pyShipping/1.8a/). The > standalone program from the command line works quickly. However, after I've > incorporated the c

Re: [web2py] Python Performance Issue

2014-03-17 Thread Jonathan Lundell
On 17 Mar 2014, at 9:21 AM, horridohobbyist wrote: > WTF. Now, both Apache and Gunicorn are slow. Equally slow! > I really think it'd simplify matters to reproduce this outside the context of a web server. If the problem is really the GIL, then all these environment are doing is using a web se

Re: [web2py] Re: Python Performance Issue

2014-03-17 Thread horridohobbyist
I don't know if bumping up the number of processors from 1 to 4 makes sense. I have a dual-core Mac mini. The VM may be doing something funny. I changed to 2 processors and we're back to the 10x performance discrepancy. So whether it's 1 or 2 processors makes very little difference. Apache:Elap

[web2py] Can the DAL produce pivot table query (for use with Google Charts Plugin)?

2014-03-17 Thread Michael Beller
I'm trying to create a query that produces a pivot table. I have a Project and Project Status table. Each Project has a Status reference field to a Project Status and a Manager reference field to an Auth User. db.define_table('t_project_status', Field('f_name', requires=IS_NOT_EMPTY(), lab

[web2py] Re: Table design question - displaying descriptive text for integer field

2014-03-17 Thread Derek
Create a table for priority definitions, give them ids and labels... use represent on the priority field of the task table. On Friday, March 14, 2014 4:53:27 PM UTC-7, Dan Why wrote: > > > I am building a TODO-list type application while studying web2py. For each > task, I would like to set a pr

[web2py] Re: Appadmin on 2.9.4

2014-03-17 Thread Niphlod
the core chapter is long, but full of gems : http://web2py.com/books/default/chapter/29/04/the-core#Static-asset-management On Saturday, March 15, 2014 9:58:10 PM UTC+1, SimonD wrote: > > Hi LightDot, > Thanks for the info. I have a well thumbed printed 5th edition book and to > be honest, this

[web2py] Re: How to use AJAX within a SQLFORM.grid 'add' form

2014-03-17 Thread Derek
Chances are you didn't define a view for 'echo' so it's using a default. On Sunday, March 16, 2014 1:09:53 PM UTC-7, backseat wrote: > > Is it expected that AJAX can be used within the Add form of a > SQLFORM.grid? If so, what am I doing wrong (or is it a bug)? > > Thanks, > Keith > -- Resourc

Re: [web2py] Re: SmartGrid Add make a Fld Readonly

2014-03-17 Thread Dan Kozlowski
This does not seem to work. Maybe I am asking wrong. I have 2 date fields that get updated from a batch process so I need to restrict them from input on the create and edit form. Thanks On 03/14/2014 10:11 PM, 黄祥 wrote: i think you can achieve it using conditional for that. e.g. write_in_for

[web2py] pysimplesoap help

2014-03-17 Thread piero crisci
Hello i am trying to connect to this wsdl: http://docway.demo.3di.it/3diws/services/eXtraWay?wsdl It requires http basic authentication and i am using pysimplesoap 1.10 and i tried this configuration: from pysimplesoap.client import SoapClient location_wsdl = "http://docway.demo.3di.it/3diws/s

[web2py] Re: How to use AJAX within a SQLFORM.grid 'add' form

2014-03-17 Thread backseat
Thanks Derek, but I don't think that's it. The example in the book doesn't define a view for 'echo', and even I do define one that explicitly calls the grid view, the problem persists (is there a view for just the Add form?). -- Resources: - http://web2py.com - http://web2py.com/book (Document

Re: [web2py] Re: SmartGrid Add make a Fld Readonly

2014-03-17 Thread 黄祥
i'm sorry, my bad : # check if new or edit is in args (url) write_in_form = '*new*' in request.args or '*edit*' in request.args db.table_name.date_field_1.writeable = not write_in_form db.table_name.date_field_2.writeable = not write_in_form or another way around # check if new or edit is in ar

[web2py] Re: Go to most recent topic post

2014-03-17 Thread 黄祥
hm, it's hard to tell without seeing your code. perhaps just some query and orderby id or date on table topic post will cover it up. best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.goo

[web2py] Re: database callback return an error when using bulk_insert

2014-03-17 Thread 黄祥
any idea why this happens? or there is a limitation on bulk_insert and the database callback. thanks and 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

Re: [web2py] Re: SmartGrid Add make a Fld Readonly

2014-03-17 Thread Dan Kozlowski
I see what you are doing but still does not work. My code is below. Could I have my code in the wrong location ? def clients(): write_in_form = 'new' in request.args or 'edit' in request.args if write_in_form: db.clients.add_date.writeable=False ##db.clients.add_date.readable=Tru

[web2py] SQLFORM to json

2014-03-17 Thread David Simmons
Hi I have a SQLFORM which I embed in my web page using LOAD. If I successfully save the data in the database I want to pass the saved data back as part response.js. The idea is that a user enters data via the SQLFORM, it is s saved to the db and the data returned to the client where I add it t

[web2py] Re: Go to most recent topic post

2014-03-17 Thread Ruud Schroen
Nevermind, already did it. Was just some simple math ;) On Saturday, March 15, 2014 2:49:50 PM UTC+1, Ruud Schroen wrote: > > I'm building a small forum for my website. > > In a topic, you will see 10 posts per page. Outside the topic, in the > forum overview, each topic will have a shortcut to t

[web2py] Re: LDAP auth and user_groups

2014-03-17 Thread Massimo Di Pierro
I think it should create groups. On Monday, 17 March 2014 11:34:30 UTC-5, Thomas Bellembois wrote: > > Hello, > > Is there any way to use LDAP authentication for users and create user > groups ? > > Apparently the get_or_create_user() method does not create them when the > user comes from LDAP

Re: [web2py] Re: SmartGrid Add make a Fld Readonly

2014-03-17 Thread 黄祥
had you already try to simplify or minimalist your app first? e.g. def clients(): write_in_form_new = 'new' in request.args if write_in_form_new: db.clients.add_date.writeable = False grid = SQLFORM.smartgrid(db.clients) return locals() best regards, stifan -- Resources: - ht

[web2py] Re: pysimplesoap help

2014-03-17 Thread Tim Richardson
you need to activate basic authentication. auth.settings.allow_basic_login = True usually do this in models/db.py see https://do.growthpath.com.au/book/default/search/29?search=basic+authentication On Tuesday, 18 March 2014 08:02:37 UTC+11, piero crisci wrote: > > Hello i am trying to connec

Re: [web2py] Re: Python Performance Issue

2014-03-17 Thread Tim Richardson
> > There is no question that the fault lies with Apache. > > Perhaps it is fairer to say the fault lies with mod_wsgi ? What are the mod_wsgi settings in your apache config? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source c

Re: [web2py] Re: Python Performance Issue

2014-03-17 Thread horridohobbyist
How or where do I locate the mod_wsgi settings? (I am the furthest thing from being an Apache expert as you can find.) Thanks. On Monday, 17 March 2014 20:20:00 UTC-4, Tim Richardson wrote: > > > >> There is no question that the fault lies with Apache. >> >> > Perhaps it is fairer to say the fa

Re: [web2py] Re: Python Performance Issue

2014-03-17 Thread Tim Richardson
(I am the furthest thing from being an Apache expert as you can find.) Well, whereever that puts you, I'll be in shouting distance. I guess this means you are using defaults. The defaults are sensible for small loads, so I don't think you would get better performance from tweaking. These def

[web2py] What's the correct implementation of cache.action?

2014-03-17 Thread Lisandro
I've a news site on production running web2py (Version 2.8.2-stable+timestamp.2013.11.28.13.54.07). The site is getting a lot of visits; major part of those visits go to the homepage. In order to optimize the site's homepage, my first step was to cache "the data". So I used selects with cacheab

Re: [web2py] Re: Python Performance Issue

2014-03-17 Thread horridohobbyist
I don't know if this is relevant, but in apache2.conf, there is a MaxClients parameter for the "prefork" MPM and it's set to 150. This is the default. I changed it to 15, but it made no difference in the test. On Monday, 17 March 2014 21:15:12 UTC-4, Tim Richardson wrote: > > > (I am the furth

Re: [web2py] Re: Python Performance Issue

2014-03-17 Thread horridohobbyist
I'm disturbed by the fact that the defaults are "sensible". That suggests there is no way to improve the performance. A 2x-10x performance hit is very serious. I was considering dropping Apache and going with nginx/gunicorn in my Linux server, but I'm not sure that's a good idea. Apache is a ne

Re: [web2py] Re: SmartGrid Add make a Fld Readonly

2014-03-17 Thread Dan Kozlowski
I am getting the same result with a minimalist controller. The field still takes a date and updates. Do you think that is a bug or something that can not be done ? On 03/17/2014 06:39 PM, 黄祥 wrote: had you already try to simplify or minimalist your app first? e.g. def clients(): write_in

Re: [web2py] Re: Python Performance Issue

2014-03-17 Thread Tim Richardson
I use apache. I think while your results are precise and interesting, real world experience of site visitors is very different. nginx met the "10K" challenge: i.e., 1 simultaneous requests. That's the kind of load that gives Apache problems. But under lower loads, there are many other factor

[web2py] Re: Web2Py without Bootstrap

2014-03-17 Thread Pedro Pisandelli
Thanks Massimo! I was searching, trying and finaly get the point. My problem was that I was working exactly in SQLFORM and navbar, that´s why I was seeing things "so tied" to Bootstrap. I made my own navbar, instead of using response.menu.. for now is pretty fine. Later will discover how to buil

Re: [web2py] Re: Python Performance Issue

2014-03-17 Thread Massimo Di Pierro
People have found lots of variability in performance with apache+mod_wsgi. Performance is very sensitive to memeory/etc. This is because Apache is not async (like nginx) and it either uses threads or processes. Both have issues with Python. Threads slow you down because of the GIL. Parallel pro

[web2py] Re: Bootstrap3 package - help to test

2014-03-17 Thread Dmitry Rodetsky
Actually there is still a problem. Although the index out of range fault went away and reCaptcha displays now - it does not test and simply continues with submission. I've been trying to find where the problem is for a few hours so far, but no luck for now. -- Resources: - http://web2py.com -

Re: [web2py] pysimplesoap help

2014-03-17 Thread Mariano Reingart
Hi piero: The first choice to connect to a webservice that requires username & password (add_credentials), you will httplib2 installed: https://code.google.com/p/httplib2 Then you could do: client = SoapClient(location = location_wsdl,sessions=True,username='admin', password='xx') Also, as