I'm running almost the latest trunk, # 4e02406b61c9de725a0b73ae9b73b71f4b1c2413

(from 16 hours ago)

And have been getting this error.

Maybe I've misordered things... here is my db.py: http://pastebin.com/1gE50Rnn

(my controller is the same as in the web2pyslice page)

On Thu, Aug 16, 2012 at 8:53 PM, Carl Roach <m...@carlroach.com> wrote:
> Then you got a real note resting exception:
>
> <type 'exceptions.ImportError'> No module named google.appengine.api
>
>
> I didn't get this. I'm using latest Web2py.
>
>
> On 16 Aug 2012, at 11:51, Alec Taylor <alec.tayl...@gmail.com> wrote:
>
> I'm not using GAE, I've tried to get it working on the Rocket server
> and on Red Hat's server (Apache), but both give me that same error.
>
> On Thu, Aug 16, 2012 at 8:48 PM, Carl Roach <m...@carlroach.com> wrote:
>
> I haven't integrated this LinkedIn with GAE just yet. I'll see if I get the
> same exception when I do.
>
>
> On 16 Aug 2012, at 11:45, Alec Taylor <alec.tayl...@gmail.com> wrote:
>
>
> I for one couldn't get the session variable to work properly, and
>
> received an error (see:
>
> https://groups.google.com/forum/#!topic/web2py/D7hwgsbBemk)
>
>
> On Thu, Aug 16, 2012 at 8:38 PM, Carl <m...@carlroach.com> wrote:
>
> Having used Udi's additions to Web2py to get basic authentication using
>
> LinkedIn working I'd like to interact with the LinkedIn API.
>
>
> I can get to this functonality using linkedin.py (by Ozgur Vatansever) in a
>
> controller using "auth.settings.login_form.session.linkedin"
>
> e.g., auth.settings.login_form.session.linkedin.get_search(...)
>
>
> this "auth.settings.login_form.session.linkedin" feels rather brittle. Is
>
> it? Is a better way to access the function get_search() ?
>
>
>
>
> On Wednesday, 15 August 2012 17:05:58 UTC+1, Massimo Di Pierro wrote:
>
>
> or to
>
>
> redirect(URL('user', args='login'))
>
>
> or to
>
>
> redirect(URL('user/ogin'))
>
>
>
> On Wednesday, 15 August 2012 08:57:20 UTC-5, Carl wrote:
>
>
> Found this code very useful! Udi's time has saved me so much time.
>
>
> One minor change I made was to user() function in default.py.
>
> The redirect() calls parameters:
>
>
> change
>
> redirect(URL('user', 'login'))
>
> to
>
> redirect(URL(f='user', args=['login',]))
>
>
>
>
>
> On Wednesday, 4 April 2012 06:49:46 UTC+1, Udi Milo wrote:
>
>
> It took a while to figure out, but this is my version on how to use
>
> linkedIn in web2py,
>
> comments are much appreciated. (its very detailed and intended for
>
> people that are just starting out like me)
>
>
> Enjoy!
>
>
> first thing, go to linkedIn.com and get your key and secret.
>
> after getting it:
>
>
> 1. add linkedIn.py and model.py to Modules from the python-linkedin lib
>
> 2. add the linkedinAccount.py to modules. modify it to look like:
>
>
> from gluon.http import HTTP
>
> try:
>
>   import linkedin
>
> except ImportError:
>
>   raise HTTP(400,"linkedin module not found")
>
>
> class LinkedInAccount(object):
>
>   def __init__(self,request,session,key,secret,return_url):
>
>       self.request = request
>
>       self.session = session
>
>
>       if self.session.linkedin is None:
>
>           self.session.verified = False
>
>           self.session.linkedin =
>
> linkedin.LinkedIn(key,secret,return_url, gae=True)
>
>           self.session.linkedin.request_token()
>
>
>   def verify(self, verifier):
>
>       self.session.verified = verifier and
>
> self.session.linkedin.access_token(verifier = verifier)
>
>       return self.session.verified
>
>
>   def login_url(self, next="/"):
>
>       return self.session.linkedin.get_authorize_url()
>
>
>   def logout_url(self, next="/"):
>
>       self.session.linkedin = None
>
>       return next
>
>
>   def get_user(self):
>
>       if self.session.verified:
>
>           profile = self.session.linkedin.get_profile(fields=['id',
>
> 'first-name', 'last-name','picture-url','industry'])
>
>           return dict(first_name = profile.first_name,
>
>                       last_name = profile.last_name,
>
>                       picture_url = profile.picture_url,
>
>                       industry = profile.industry,
>
>                       username = profile.id)
>
>
> 3. add the following to your dal.py
>
>
> ## LinkedIn
>
>
> auth.settings.actions_disabled=['register','change_password','request_reset_password','retrieve_username']
>
> from linkedinAccount import LinkedInAccount
>
> auth.settings.login_form=LinkedInAccount(
>
>   request,
>
>   session,
>
>   KEY,
>
>   SECRET,
>
>   'http://' + request.env.http_host + '/user/verify')
>
>
> and just above "auth.define_tables()" add this:
>
>
> ## create custom field 'username' for linkedin authentication
>
> auth.settings.extra_fields['auth_user']= [
>
>   Field('username', writable=False, readable=False),
>
>   Field('picture_url', writable=False, readable=False),
>
>   Field('industry', writable=False, readable=False),
>
> ]
>
>
> 4. add the following to your default.py, the user function (clear is a
>
> debug tool, in case your session expires or you play with it and you need to
>
> remove it)
>
>
> def user():
>
>   if len(request.args)>0 and request.args(0)=='verify':
>
>       auth.settings.login_form.verify(request.vars.oauth_verifier)
>
>       redirect(URL('user', 'login'))
>
>
>   if request.args(0)=='clear':
>
>       session.linkedin = None
>
>       return 'clean'
>
>
>
> --
>
>
>
>
>
> --
>
>
>
>
>
> --
>
>
>
>
>
> --
>
>
>
> --
>
>
>

-- 



Reply via email to