Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
138 views
in Technique[技术] by (71.8m points)

python 3.x - Overriding package libraries in Google App Engine project

I am writing a Google App Engine Django REST Framework project that uses external libraries through requirements.txt. In one of the of files in a module installed in requirements.txt, I am manually editing some code there. How do I get GAP to use this modified version instead of original one.

The way I am doing this is installing the packages in a folder called lib, modifying the package inside it and then creating a file called appengine_config.py which contains this:

from google.appengine.ext import vendor

vendor.add('lib')

But when I deploy it, it still uses the original package in requirements.txt. Any idea how to make this work?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

GAE will use requirements.txt and install those libraries in the lib folder when you deploy. That is just how it works.

Nothing prevents you from deploying code outside the lib folder. You can structure your project like this:

GAE_folder:
-- app.yaml
-- requirements.txt
-- lib
-- my_app
-- my_custom_lib

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...