[web2py] Re: Cant get emails to send from Google App Engine App

2012-01-07 Thread Ben
Substitute the stuff in quotes with your info:

mail.settings.sender = "m...@mydomain.com"
mail.settings.login = "m...@mydomain.com:mypassword"


Notes:
This "gae" setting (vs. "smtp.gmail.com:587") works for me with a
Google Apps hosted email, but I've found it doesn't seem to work from
the developer console.  However, it works just fine from App Engine
once uploaded.



On Jan 6, 6:39 pm, chawk  wrote:
> I have my db.py file setup this way
>
>     ## configure email
>     mail=Mail()
>     mail.settings.server="gae"
>     mail.settings.sender="myaddress.com"
>     mail.settings.login="username:password"
>
> I have been trying this for hours, I get no errors, when i call
> functions to send emails they return true, so I am assuming they are
> supposed to be working, but the messages never show up in my inbox.


[web2py] Re: db unique=True Not working

2012-01-07 Thread Alan Etkin
I think that requires=IS_EMPTY_OR(IS_IN_DB(...)) should give the user
the options plus an empty option to leave the field blank, but i am
not sure if the value stored is null if empty is selected.

On Jan 7, 12:51 am, Bruce Wade  wrote:
> Ok thanks I was trying that except I couldn't figure out how to do the last
> part 'ads.url' to point to that field, kept getting ads does not exist
> error because I wasn't using the ' ' with ads.url.
>
> What about the second problem? Is it possible to allow null but also have
> the IS_IN_DB to provide a select combo?
>
> In other words if some ones location does not exist currently in the
> database I want to give them a checkbox that if checked
> country, province and city can be NULL, behind the scene the checkbox will
> email customer service to contact that member about the location to add
> etc..
>
> Thanks,
> Bruce
>
>
>
> On Fri, Jan 6, 2012 at 5:18 PM, Anthony  wrote:
> > unique=True is enforced at the level of the database, not the form. If you
> > want to validate form input, you have to provide a validator in the field's
> > "requires" attribute:
>
> > Field('url', unique=True, requires=[IS_NOT_IN_DB(db, 'ads.url'), IS_URL()])
>
> > Seehttp://web2py.com/books/default/chapter/29/6#Record-representationand
> >http://web2py.com/books/default/chapter/29/7#Database-validators.
>
> > Anthony
>
> > On Friday, January 6, 2012 7:34:10 PM UTC-5, Detectedstealth wrote:
>
> >> When using unique=True on my database model the validation is allowing 
> >> duplicates to pass through the form validation. Also notnull=False does 
> >> NOT allow me to store Null entries for country, province, city.
>
> >> db.define_table('ads',
> >>     Field('member_id', db. user_account, default=auth.user.account_id),
> >>     Field('points', 'integer', default=0),
> >>     Field('url', unique=True, requires=IS_URL()),
> >>     Field('language', db.languages, requires=IS_IN_DB(db, db.languages.id, 
> >> '%(language)s')),
> >>     Field('country', db.countries, requires=IS_IN_DB(db, db.countries.id, 
> >> '%(name)s'), notnull=False, default=None),
> >>     Field('province', db.provinces, requires=IS_IN_DB(db, db.provinces.id, 
> >> '%(name)s'), notnull=False, default=None),
> >>     Field('city', db.cities, requires=IS_IN_DB(db, db.cities.id, 
> >> '%(name)s'), notnull=False, default=None),
> >>     Field('accepted', 'boolean', default=False),
> >>     Field('viewable', 'boolean', default=True),
> >>     Field('updated_at', 'datetime', default=request.now, writable=False),
> >>     Field('added_at', 'datetime', default=request.now, writable=False)
> >> )
>
> >> def createad():
> >>     table = ads_api.getDatabaseTable()
> >>     table.member_id.readable = table.member_id.writable = False
> >>     table.accepted.readable = table.accepted.writable = False
> >>     form = SQLFORM(table)
> >>     if form.accepts(request,session, keepvalues=True):
> >>         response.flash = 'form accepted'
> >>     elif form.errors:
> >>         response.flash = 'form has errors'
> >>     else:
> >>         response.flash = 'please fill the form'
> >>     return dict(form=form)
>
> >> IntegrityError: duplicate key value violates unique constraint 
> >> "ads_url_key"
> >> DETAIL:  Key (url)=(http://wadecybertech.co**m) already exists.
>
> >> Am I doing something incorrect? I basically want a form that allows 
> >> country, province, city to be NULL OR a valid item already in the 
> >> database, finally I want the url column to be unique. However when a value 
> >> already exists and I submit the form I get the IntegrityError.
>
> >> --
> >> --
> >> Regards,
> >> Bruce Wade
> >>http://ca.linkedin.com/in/**brucelwade
> >>http://www.wadecybertech.com
> >>http://www.warplydesigned.com
> >>http://www.**fitnessfriendsfinder.com
>
> --
> --
> Regards,
> Bruce 
> Wadehttp://ca.linkedin.com/in/brucelwadehttp://www.wadecybertech.comhttp://www.warplydesigned.comhttp://www.fitnessfriendsfinder.com


[web2py] Alternative for GROUP BY in app-engine

2012-01-07 Thread sabbir
Hi All,

Wondering how to best implement GROUP BY in google app-engine, on
large data set.

Example Entity:
>>Transaction (sl, accountsCode, accountsName, amount, status)

Then what is the best approach to do something like this in app-
engine:
>> select accountsCode, sum(amount)

What I can do with brute force is -
   - Select All
   - Then read each record
   - populate a List with sum / count

But this seems so inefficient, and will require too much extra code.


Thanks,
sabbir


[web2py] column auth_user.registration_id does not exist ERROR AFTER UPGRADE to 1.99

2012-01-07 Thread david.waldrop
after an upgrade to 1.99 i get an error stating as in the subject above 
when trying to login.  I tried to use the admin interface to inspect the 
auth_user table, but get the same error in the admin interface.  Did 
something change to the table structures?  if so, any idea how I can fix?

Re: [web2py] Re: db unique=True Not working

2012-01-07 Thread Bruce Wade
Thanks Alan, I will give that a try.

--
Regards,
Bruce

On Sat, Jan 7, 2012 at 2:32 AM, Alan Etkin  wrote:

> I think that requires=IS_EMPTY_OR(IS_IN_DB(...)) should give the user
> the options plus an empty option to leave the field blank, but i am
> not sure if the value stored is null if empty is selected.
>
> On Jan 7, 12:51 am, Bruce Wade  wrote:
> > Ok thanks I was trying that except I couldn't figure out how to do the
> last
> > part 'ads.url' to point to that field, kept getting ads does not exist
> > error because I wasn't using the ' ' with ads.url.
> >
> > What about the second problem? Is it possible to allow null but also have
> > the IS_IN_DB to provide a select combo?
> >
> > In other words if some ones location does not exist currently in the
> > database I want to give them a checkbox that if checked
> > country, province and city can be NULL, behind the scene the checkbox
> will
> > email customer service to contact that member about the location to add
> > etc..
> >
> > Thanks,
> > Bruce
> >
> >
> >
> > On Fri, Jan 6, 2012 at 5:18 PM, Anthony  wrote:
> > > unique=True is enforced at the level of the database, not the form. If
> you
> > > want to validate form input, you have to provide a validator in the
> field's
> > > "requires" attribute:
> >
> > > Field('url', unique=True, requires=[IS_NOT_IN_DB(db, 'ads.url'),
> IS_URL()])
> >
> > > Seehttp://
> web2py.com/books/default/chapter/29/6#Record-representationand
> > >http://web2py.com/books/default/chapter/29/7#Database-validators.
> >
> > > Anthony
> >
> > > On Friday, January 6, 2012 7:34:10 PM UTC-5, Detectedstealth wrote:
> >
> > >> When using unique=True on my database model the validation is
> allowing duplicates to pass through the form validation. Also notnull=False
> does NOT allow me to store Null entries for country, province, city.
> >
> > >> db.define_table('ads',
> > >> Field('member_id', db. user_account,
> default=auth.user.account_id),
> > >> Field('points', 'integer', default=0),
> > >> Field('url', unique=True, requires=IS_URL()),
> > >> Field('language', db.languages, requires=IS_IN_DB(db,
> db.languages.id, '%(language)s')),
> > >> Field('country', db.countries, requires=IS_IN_DB(db,
> db.countries.id, '%(name)s'), notnull=False, default=None),
> > >> Field('province', db.provinces, requires=IS_IN_DB(db,
> db.provinces.id, '%(name)s'), notnull=False, default=None),
> > >> Field('city', db.cities, requires=IS_IN_DB(db, db.cities.id,
> '%(name)s'), notnull=False, default=None),
> > >> Field('accepted', 'boolean', default=False),
> > >> Field('viewable', 'boolean', default=True),
> > >> Field('updated_at', 'datetime', default=request.now,
> writable=False),
> > >> Field('added_at', 'datetime', default=request.now, writable=False)
> > >> )
> >
> > >> def createad():
> > >> table = ads_api.getDatabaseTable()
> > >> table.member_id.readable = table.member_id.writable = False
> > >> table.accepted.readable = table.accepted.writable = False
> > >> form = SQLFORM(table)
> > >> if form.accepts(request,session, keepvalues=True):
> > >> response.flash = 'form accepted'
> > >> elif form.errors:
> > >> response.flash = 'form has errors'
> > >> else:
> > >> response.flash = 'please fill the form'
> > >> return dict(form=form)
> >
> > >> IntegrityError: duplicate key value violates unique constraint
> "ads_url_key"
> > >> DETAIL:  Key (url)=(http://wadecybertech.co**m) already exists.
> >
> > >> Am I doing something incorrect? I basically want a form that allows
> country, province, city to be NULL OR a valid item already in the database,
> finally I want the url column to be unique. However when a value already
> exists and I submit the form I get the IntegrityError.
> >
> > >> --
> > >> --
> > >> Regards,
> > >> Bruce Wade
> > >>http://ca.linkedin.com/in/**brucelwade<
> http://ca.linkedin.com/in/brucelwade>
> > >>http://www.wadecybertech.com
> > >>http://www.warplydesigned.com
> > >>http://www.**fitnessfriendsfinder.com<
> http://www.fitnessfriendsfinder.com>
> >
> > --
> > --
> > Regards,
> > Bruce Wadehttp://
> ca.linkedin.com/in/brucelwadehttp://www.wadecybertech.comhttp://www.warplydesigned.comhttp://www.fitnessfriendsfinder.com
>



-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


[web2py] Re: define_table - how to do this correctly (best practice?)

2012-01-07 Thread lyn2py
Bump. Help anyone?

Can "default" be equal to a variable dependent on another field in the
same table?

Thanks!

On Jan 6, 6:10 am, lyn2py  wrote:
> What you say is true, however for argument's sake, how could I achieve
> the above with the 4th table?
>
> In my situation, the 3 tables have different fields (but I didn't have
> access to the file so I simply made them the same in the example here.
>
> Thanks.
>
> On Jan 6, 1:24 am, Andrew  wrote:
>
>
>
>
>
>
>
> > I think this is more of a data modeling question than web2py.
> > I would have one table called "content" with an extra column
> > "content_type" .  You could define queries over the top if you just
> > want one ofthe three.
>
> > Your M:M table logically joins to "content".  You sort of have three
> > subtype tables, but they are identical in structure so there is no
> > reason to separate,
>
> > On Jan 6, 5:22 am, lyn2py  wrote:
>
> > > I have tables with individual properties,
>
> > > db.define_table('article',
> > >   Field('title', 'string', length=255,required=True),
> > >   Field('description', 'text',required=True),
> > > )
> > > db.define_table('post',
> > >   Field('title', 'string', length=255,required=True),
> > >   Field('description', 'text',required=True),
> > > )
> > > db.define_table('page',
> > >   Field('title', 'string', length=255,required=True),
> > >   Field('description', 'text',required=True),
> > > )
>
> > > And I have a table with many-to-many relationship (with different
> > > tables):
>
> > > db.define_table('action',
> > >   Field('user_id','reference
> > > auth_user',default=auth.user_id,required=True),
>
> > > Field('action','string',requires=IS_IN_SET(('fav','subscribe','report','fol
> > >  low')),required=True),
> > >   Field('table',requires=???,required=True),
> > >   Field('table_id','integer',default=???,required=True),
> > > )
>
> > > My questions:
> > > 1.. The field, "table" is actually one of the tables, article/post/
> > > page. Is the only correct way to use
> > > requires=IS_IN_SET(('article','post','page')) ?
>
> > > 2.. "table_id" is actually dependent on the "table" selected. what
> > > should I put for "default=???"
>
> > > 3.. Can I set a different set of IS_IN_SET for "action" field,
> > > depending on the "table" field chosen?
>
> > > 4.. Finally, if the above is the wrong approach, how should I do it
> > > correctly (best practice?)
>
> > > Thanks!


[web2py] Re: define_table - how to do this correctly (best practice?)

2012-01-07 Thread Anthony

>
> Can "default" be equal to a variable dependent on another field in the 
> same table?
>

I haven't looked at your original question in detail, but regarding the 
above question about defaults, no, they can't be dependent on other fields 
in the same table (though they can be dependent on request.vars, including 
request.vars that have been submitted to fill other fields in the table). 
An alternative is to set the "compute" attribute of the field, which can 
(and is intended to) depend on other fields in the table (see 
http://web2py.com/books/default/chapter/29/6#Computed-fields). You can 
insert a value directly into the field, but if no value is provided, it 
will compute a value according to the compute function. Note, by default 
computed fields are not shown in SQLFORMs, though you can explicitly list 
them among the fields to be shown.

Anthony 


[web2py] Re: Mobile OTP (motp) and other OTP login methods for web2py

2012-01-07 Thread howesc
sounds cool.

the formula will be similar to what i did here to add facebook, twitter, 
google accounts auth to web2py: 
http://www.web2pyslices.com/slices/take_slice/77

obviously the custom methods will interact with OTP, but the formula should 
be similar.

cfh


[web2py] Re: column auth_user.registration_id does not exist ERROR AFTER UPGRADE to 1.99

2012-01-07 Thread Alan Etkin
Seems like a bug. Could you post the error traceback? It happens with
every application in the web2py installation?

On Jan 7, 11:21 am, "david.waldrop"  wrote:
> after an upgrade to 1.99 i get an error stating as in the subject above
> when trying to login.  I tried to use the admin interface to inspect the
> auth_user table, but get the same error in the admin interface.  Did
> something change to the table structures?  if so, any idea how I can fix?


[web2py] Re: define_table - how to do this correctly (best practice?)

2012-01-07 Thread lyn2py
Thanks Anthony, will look into the areas you mentioned! :)

On Jan 8, 12:35 am, Anthony  wrote:
> > Can "default" be equal to a variable dependent on another field in the
> > same table?
>
> I haven't looked at your original question in detail, but regarding the
> above question about defaults, no, they can't be dependent on other fields
> in the same table (though they can be dependent on request.vars, including
> request.vars that have been submitted to fill other fields in the table).
> An alternative is to set the "compute" attribute of the field, which can
> (and is intended to) depend on other fields in the table 
> (seehttp://web2py.com/books/default/chapter/29/6#Computed-fields). You can
> insert a value directly into the field, but if no value is provided, it
> will compute a value according to the compute function. Note, by default
> computed fields are not shown in SQLFORMs, though you can explicitly list
> them among the fields to be shown.
>
> Anthony


Re: [web2py] Re: web2py on github

2012-01-07 Thread Bruce Wade
If anyone is interested I found assembla.com which allows unlimited
repositories, with unlimited members for both public and private projects.

On Thu, Dec 22, 2011 at 5:45 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> No problem at all Daniel, I welcome the discussion. I am just saying
> do not get upset if I am slow on this side. ;-)
>
> On Dec 22, 12:59 am, Daniel Aguayo Catalán 
> wrote:
> > Massimo Di Pierro wrote:
> > > I hate all changes related to this topic. This is because I have to
> > > learn a new system and do extra work to move stuff around. There was a
> > > lot of push for git and github so we did it.
> >
> > > Please, let's not open this can of worms again. The costs of changing
> > > outweighs the benefits.
> >
> > > Massimo
> >
> > He he, don't worry :). My apologies if this topic is still kind of
> > sensible. I thought that bitbucket was more restrictive and the free
> > private project hosting was a plus and killer feature over other
> > services, at least for me (that sadly have not gitourious nor github).
> > So I just wanna to know a comparison of bitbucket and github from your
> > perspective to choose my personal repo, but now I can see that was
> > nothing in particular.
> >
> > I know that github is the 'pop-choice' for project hosting these days
> > and I have no problem with that (gitorious.org and bitbucket has fairly
> > same workflow as github), so please don't considerate this as a kind of
> > flame of DVCS hosting.
> >
> > Thanks to all for your answer.
> > Best regards
> > --
> > Daniel
>



-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


[web2py] Re: Packaging web2py + application

2012-01-07 Thread LightDot
Yes, rpmbuild with spec files. Actually, I build packages for several 
architectures and OS versions, so I use mock - a tool that builds** RPMs in 
a clean, chrooted environment. But that's pretty much equivalent to plain 
rpmbuild with chroot and some additional automation.


[web2py] Re: column auth_user.registration_id does not exist ERROR AFTER UPGRADE to 1.99

2012-01-07 Thread Massimo Di Pierro
What did you upgrade from? Are migrations on? It is possible you
upgraded from an old web2py and it needs to create the
auth_user.registration_id which was added about 1 year ago.

On Jan 7, 8:21 am, "david.waldrop"  wrote:
> after an upgrade to 1.99 i get an error stating as in the subject above
> when trying to login.  I tried to use the admin interface to inspect the
> auth_user table, but get the same error in the admin interface.  Did
> something change to the table structures?  if so, any idea how I can fix?


[web2py] best way to process date deltas?

2012-01-07 Thread Adrian Edwards
Hello,

What's the best way to calculate deltas between 2 dates? For example I
need to calculate how many days are inbetwen 12/31/2011 and today.
Then if the delta is a factor of 7 (weekly) do something.

Thanks.
Adrian


[web2py] Re: processing user input

2012-01-07 Thread Adrian Edwards
Thank you both, I appreciate the help.

On Jan 2, 9:33 pm, Anthony  wrote:
> You can use the 'onvalidation'
> callback:http://web2py.com/books/default/chapter/29/7#onvalidation
>
> form.process(..., onvalidation=my_form_calculation)
>
> You can also define a custom validator for the field to calculate and
> return the transformed value --
> seehttp://web2py.com/books/default/chapter/29/7#Custom-validators.
>
> Finally, if you want to do something with the submitted vars before
> validation, you can access the vars in request.vars.
>
> Anthony
>
>
>
> On Monday, January 2, 2012 7:39:46 PM UTC-5, Adrian Edwards wrote:
>
> > to expand on this a bit, I tried to put the calculations before the
> >  if form.process().accepted:
>
> > but I haven't been able to figure out how to access the value entered
> > by the user.
> > So this may just be as simple as accessing something like
> > form.custom.widget.value
>
> > Adrian.
>
> > On Jan 2, 7:35 pm, Adrian Edwards  wrote:
> > > Hello all,
>
> > > I have a page where a user enters in some data, and then some
> > > calculations need to occur before the data is put into the database.
>
> > > Right now I have
> > >    form = SQLFORM(db.entries, entry)
> > > and whatever the user enters is successfully put into db.entries.
> > > So now I want to do the calculations before populating the database,
> > > but not sure how.
>
> > > Any suggestions?
>
> > > Thanks.
> > > Adrian- Hide quoted text -
>
> - Show quoted text -


Re: [web2py] best way to process date deltas?

2012-01-07 Thread Bruno Rocha
>>> from datetime import datetime, timedelta
>>> factor = timedelta(7)
>>> now = datetime.now()
>>> past_week = now - factor
>>> past_week
datetime.datetime(*2011, 12, 31*, 18, 12, 22, 417567)
>>>


On Sat, Jan 7, 2012 at 6:06 PM, Adrian Edwards  wrote:

> Hello,
>
> What's the best way to calculate deltas between 2 dates? For example I
> need to calculate how many days are inbetwen 12/31/2011 and today.
> Then if the delta is a factor of 7 (weekly) do something.
>
> Thanks.
> Adrian




-- 

Bruno Rocha
[http://rochacbruno.com.br]


Re: [web2py] best way to process date deltas?

2012-01-07 Thread Bruno Rocha
Also:
>>> import datetime as dt
>>> date1 = dt.datetime.strptime('2011-12-31', '%Y-%m-%d')
>>> date2 = dt.datetime.now()
>>> diff = date2 - date1
>>> diff
datetime.timedelta(7, 65912, 169900)
>>> diff.days
7



-- 

Bruno Rocha
[http://rochacbruno.com.br]


[web2py] Re: Alternative for GROUP BY in app-engine

2012-01-07 Thread sabbir
It seems reading data sequentially is the only option and is costly.

My entities are already de-normalized to some extent and I cant keep
counter to a separate table as reports can have conditions like date
range and other parameters.

Now the big question is the cost of sequential search in term of
resource uses in app-engine. I am not talking about terabyte of data,
lets say about 2 million record in a single entity.

Any advice from practical experience to similar scenario is
appreciated. I am willing to leave app-engine if it seems too dirty
and costly to manage.

Thanks
Sabbir



On Jan 7, 7:07 pm, sabbir  wrote:
> Hi All,
>
> Wondering how to best implement GROUP BY in google app-engine, on
> large data set.
>
> Example Entity:
>
> >>Transaction (sl, accountsCode, accountsName, amount, status)
>
> Then what is the best approach to do something like this in app-
> engine:
>
> >> select accountsCode, sum(amount)
>
> What I can do with brute force is -
>    - Select All
>    - Then read each record
>    - populate a List with sum / count
>
> But this seems so inefficient, and will require too much extra code.
>
> Thanks,
> sabbir


[web2py] Updated: uwsgi + nginx script for Ubuntu 11.10

2012-01-07 Thread Bruce Wade
Hi,

I was having problems running setup-web2py-nginx-uwsgi-ubuntu.sh on Ubuntu
11.10 primary because of uwsgi install instructions.

I have edited the script which is working now and attached to this message
for anyone who runs into the same problem.

-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


setup-web2py-nginx-uwsgi-ubuntu.sh
Description: Bourne shell script


[web2py] Can't configure web2py with apache via xampp

2012-01-07 Thread Likit
Nothing I am doing works.  None of the web pages have answers.  I am not 
confident in the web2py book, which contains many errors.

The problem appears to be that web2py insists that the admin pages are 
accessed via ssl for the login but doesn't require (of course) ssl for the 
ordinary applications.  The problem is that apache on windows appears to 
not allow the use of two different ports with one ip address (127.0.0.1 or 
localhost) in this case.

Note that I have verified that mod_wsgi is installed properly and works. 
 In a directory, c:\webapp I have a tiny .py that successfully returns 
"hello world."  I would like to keep this around so that I continue to have 
a simple way to verify the mod_wsgi setup.  I read somewhere (I think the 
mod_wsgi site) that more than one WSGIScriptAlias directives were allowed.

No, I don't have skype or anything else listening on port 80.  I am not 
even accessing this machine over the web.  This is purely for local 
development on a single machine.  I don't want to use the builtin Rocket 
wsgi server because I want to get apache configured properly.  Later, I 
will shift to a SuSELinux development server.  After that, I will prop to 
Linode.  I suspect the latter two environments might work better than 
xampp.  it is shocking how poorly documented web2py is.  Deployment 
especially seems an afterthought.


Here is my httpd.conf file.  I have moved most of the web2py specific 
settings to httpd-alt-web2py.conf referenced via Include (below).

#
# This is the main Apache HTTP server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see 
# http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
# with ServerRoot set to "C:/xampp/apache" will be interpreted by the
# server as "C:/xampp/apache/logs/foo.log".
#
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
# If a drive letter is omitted, the drive on which httpd.exe is located
# will be used by default.  It is recommended that you always supply
# an explicit drive letter in absolute paths to avoid confusion.

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path.  If you point
# ServerRoot at a non-local disk, be sure to point the LockFile directive
# at a local disk.  If you wish to share the same ServerRoot for multiple
# httpd daemons, you will need to change at least LockFile and PidFile.
#
ServerRoot "C:/xampp/apache"
NameVirtualhost *:80
NameVirtualhost *:443
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the 
# directive.
#
# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 0.0.0.0:80
#Listen [::]:80
Listen 127.0.0.1:80
Listen 127.0.0.1:443 
# for web2py secure admin pages--this didn't work by itself??  needed more 
than one argument?
#
#
#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO 
you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule authn_alias_module modules/mod_authn_alias.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
#LoadModule authn_dbd_module modules/mod_authn_dbd.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module mod

[web2py] Re: Can't configure web2py with apache via xampp

2012-01-07 Thread Anthony

>
> I am not confident in the web2py book, which contains many errors.


Feel free to report any errors here, and they will be corrected. 


[web2py] Re: Can't configure web2py with apache via xampp

2012-01-07 Thread Anthony

>
> The problem appears to be that web2py insists that the admin pages are 
> accessed via ssl for the login but doesn't require (of course) ssl for the 
> ordinary applications.
>

Note, for local requests, admin does not require an SSL connection, so in 
development, no need for the second port. 


[web2py] Significant overhead with each define_table()

2012-01-07 Thread James M.
I just did some simple load tests on a web app I am working on.  I was
using apache bench (ab -n 1000 -c 100) and getting results that were
much slower than expected.  The Requests/Second were ~ 26.  For
comparison I did the same test against the welcome app and I was
getting ~ 59 Requests/Second (with no optimizations).
I started testing various scenarios to determine what was causing the
big discrepancy.  I tried all the suggested tips for improving
performance (migrate=False, compile app, cache, session.forget() etc),
with very small improvements...

I was curious what kind of overhead adding tables to the welcome app
would have.  To get a good starting point I decided to optimize the
page I was testing in the web app as follows:

#default.py
@cache(request.env.path_info, time_expire=60, cache_model=cache.ram)
def index():
session.forget(response)
return response.render(dict())

After this change I was getting 93 Requests/Second

I added the following table:

db.define_table('table1',
Field('col1','string'),
Field('col2','string'),
Field('col3','string'),
Field('col4','string'),
Field('col5','string'),
Field('col6','string'),
Field('col7','string'),
Field('col8','string'),
Field('col9','string'),
Field('col10','string')
)

and tested again resulting in 87 Requests/Second

I repeated adding tables (table2, table3 etc)
After adding 5 tables the test was down to 67 Requests/Second
After adding 10 tables the test was down to 52 Requests/Second
After adding 30 tables the test was down to 27 Requests/Second

The full test results are logged here:
https://docs.google.com/spreadsheet/ccc?key=0ApWaSSISueScdG1DSDl4NVNkQkQwUVlPZnNBVF9vbmc

I am starting to look at the DAL code to see if I notice anything that
can be improved, haven't noticed anything yet.  I am wondering if
anyone has any thoughts on what would be causing this.



[web2py] Re: Alternative for GROUP BY in app-engine

2012-01-07 Thread dlypka
some relevant discussion is here:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/3dfe0f3268cd7e27
 



[web2py] Re: Mobile OTP (motp) and other OTP login methods for web2py

2012-01-07 Thread whowhywhat
thanks a lot for the tip and recipe howsec.. will go through and
try .. :)
will postback

On Jan 7, 9:54 pm, howesc  wrote:
> sounds cool.
>
> the formula will be similar to what i did here to add facebook, twitter,
> google accounts auth to 
> web2py:http://www.web2pyslices.com/slices/take_slice/77
>
> obviously the custom methods will interact with OTP, but the formula should
> be similar.
>
> cfh


[web2py] Re: Significant overhead with each define_table()

2012-01-07 Thread Massimo Di Pierro
The code in models is executed at every http request. The longer the
models, the more slow down. Yet the slow down you get is larger than I
would have expected. I did some tests about this long ago and I found
this issue to be negligible. Let us know what you find and I will take
a look too. Meanwhile, what os are you suing?

On Jan 7, 9:44 pm, "James M."  wrote:
> I just did some simple load tests on a web app I am working on.  I was
> using apache bench (ab -n 1000 -c 100) and getting results that were
> much slower than expected.  The Requests/Second were ~ 26.  For
> comparison I did the same test against the welcome app and I was
> getting ~ 59 Requests/Second (with no optimizations).
> I started testing various scenarios to determine what was causing the
> big discrepancy.  I tried all the suggested tips for improving
> performance (migrate=False, compile app, cache, session.forget() etc),
> with very small improvements...
>
> I was curious what kind of overhead adding tables to the welcome app
> would have.  To get a good starting point I decided to optimize the
> page I was testing in the web app as follows:
>
> #default.py
> @cache(request.env.path_info, time_expire=60, cache_model=cache.ram)
> def index():
>     session.forget(response)
>     return response.render(dict())
>
> After this change I was getting 93 Requests/Second
>
> I added the following table:
>
> db.define_table('table1',
>         Field('col1','string'),
>         Field('col2','string'),
>         Field('col3','string'),
>         Field('col4','string'),
>         Field('col5','string'),
>         Field('col6','string'),
>         Field('col7','string'),
>         Field('col8','string'),
>         Field('col9','string'),
>         Field('col10','string')
> )
>
> and tested again resulting in 87 Requests/Second
>
> I repeated adding tables (table2, table3 etc)
> After adding 5 tables the test was down to 67 Requests/Second
> After adding 10 tables the test was down to 52 Requests/Second
> After adding 30 tables the test was down to 27 Requests/Second
>
> The full test results are logged 
> here:https://docs.google.com/spreadsheet/ccc?key=0ApWaSSISueScdG1DSDl4NVNk...
>
> I am starting to look at the DAL code to see if I notice anything that
> can be improved, haven't noticed anything yet.  I am wondering if
> anyone has any thoughts on what would be causing this.