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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to