ImportError, using pytz in google app engine

后端 未结 2 1944
难免孤独
难免孤独 2020-12-21 23:18

I\'m trying to use pytz in my web app to apply a timezone to a datetime object. First I tried importing pytz like this

from pytz import timezone
         


        
2条回答
  •  情歌与酒
    2020-12-22 00:02

    Neither pytz or pytz.gae are included with the default App Engine SDK.

    If you want to use the pytz.gae module, you will need to download it and copy it to your application folder.

    Your import line below assumes that you have the gae.py file in a 'pytz' folder under the root folder of your appengine application source.

    You can download the pytz.gae module from here: https://code.google.com/p/gae-pytz/

    I use it with a Python 2.7 GAE app and it works fine.

提交回复
热议问题