Monday 15 September 2014

python - How to use module from /usr/local/lib/python2.7/dist-packages in appengine app -


Let me start by saying that I do not think that it can actually work, however, I'm sure First of all I attempted to pull into this library so I used Easy_install to add an API library found on Github. I was hoping to use it in my appengine app I have written a simple test handle which will make an example of the main square of the module and print a request. My dev_appserver will start but will not load the men page. any advice is appreciated!

Error:

  Error 2013-06-21 04: 24: 00,450 wsgi.py Differences] Traceback (most recent call final): File "/ home /develop/google_appengine/google/appengine/runtime/wsgi.py ", line 1 9 6, handler = _config_handle.add_wsgi_middleware (self._LoadHandler ()) file in handler" / home / Devin / google_appengine / google / appengine / runtime / Wsgi.py ", line 255, _LoadHandler handler = __import__ (path [0]) file" /home/devin/Projects/appengine/hackTheMidwest/perfectpet4me.py ", line 4, & lt; Module & gt; Import PatternFire Import Import: Firefighter information 2013-06-21 04: 24: 00,455 server.pySTART_STRONG3Default: "GET / HTTP / 1.1" 500 -   

and here is my main file Code for:

  Import Import urlib Import Patiofile # Imported from imported users from Google.appengine.api Library Import jinja2 import webapp2 JINJA_ENVIRONMENT = jinja2 Environment (Loader = Genezi 2.File SystemLoader (Os.path.dirname (__ file__)), extension = ['jinja2.ext.autoescape']) class home page (webapp2.RequestHandler): def mill (auto): template = JINJA_ENVIRONMENT .get_template ('templates / index' html) Self.response.write (template.render ()) Class testpages (webapp2.RequestHandler): def find (auto): #Instantize customer with your credentials Api = petfinder.PetFinderClient (Api_key = '#####, api_secret =' ##### ') pet = api.pet_getrandom () self.response.write (pet [' name ']) application = webapp2.   

and my app.yaml:

      Application: ASDFASDFASDF Version: 1 runtime : Pathon 27 API_version: 1 ThreadSefe: True - URL: /.* Script: Full Pte .4.Applications Libraries: - Name: WebPop 2 Version: Latest - Name: Genza 2 Version: Latest    

This is the true purpose of the Ganav tool created for Google App Engine. Here is a blog post for more details: < / P>

But this is the summary: Let's install it:

  pip install gaenv cd / to / your / project gaenv   

Make sure you have your third party There are packages and installed and it will create a symink, so that it can be uploaded after the applyingInfgg Simlink.

You can also read the code on github on how everything works:

No comments:

Post a Comment