sample_fab.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:thecovfefeblog 作者: othreecodes 项目源码 文件源码
def run_upload_db(filename=None):
    """
    Uploads your local database to the server.
    You can create a local dump with ``fab export_db`` first.
    In order to import the database on the server you still need to SSH into
    the server.
    Usage::
        fab prod run_upload_db
        fab prod run_upload_db:filename=foobar.dump
    """
    if not filename:
        filename = settings.DB_DUMP_FILENAME
    if env.key_filename:
        ssh = settings.PROJECT_NAME
    else:
        ssh = '{0}@{1}'.format(env.user, env.host_string)
    local('scp {0} {1}:{3}'.format(
        filename, ssh, settings.FAB_SETTING('SERVER_DB_BACKUP_DIR')))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号