app-engine-patch manage.py 使用的数据存储路径与运行 dev_appserver.py 时使用的默认路径不同的问题
默认值为:
- %TEMP%\dev_appserver.datastore
- %TEMP%\dev_appserver.datastore.history
manage.py 使用:
- %TEMP%\django_。数据存储
- %TEMP%\django_.datastore.history
这可以通过项目设置进行自定义。负责这种差异的函数在 \django\db\backends\appengine\base.py 中:
def get_datastore_paths(settings_dict):
"""Returns a tuple with the path to the datastore and history file.
The datastore is stored in the same location as dev_appserver uses by
default, but the name is altered to be unique to this project so multiple
Django projects can be developed on the same machine in parallel.
Returns:
(datastore_path, history_path)
"""
from google.appengine.tools import dev_appserver_main
options = settings_dict['DATABASE_OPTIONS']
datastore_path = options.get('datastore_path',
dev_appserver_main.DEFAULT_ARGS['datastore_path'].replace(
"dev_appserver", "django_%s" % appid))
history_path = options.get('history_path',
dev_appserver_main.DEFAULT_ARGS['history_path'].replace(
"dev_appserver", "django_%s" % appid))
return datastore_path, history_path