ServerDjangoUwsgi.py 文件源码

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

项目:ezhost 作者: zhexiao 项目源码 文件源码
def install_uwsgi(self):
        if self.args.force or prompt(red(' * Install Uwsgi service (y/n)?'), default='y') == 'y':
            sudo('pip3 install uwsgi')

            # uwsgi config need real env path
            with cd(self.python_env_dir):
                real_env_path = run('pwd')

            # get user
            home_user = run('echo $USER')

            # uwsgi config string
            django_uwsgi_ini = self.django_uwsgi_ini.format(self.nginx_web_dir, self.project, real_env_path, home_user)

            # modify uwsgi config file
            with cd(self.project_dir):
                if not exists('{0}.ini'.format(self.project)):
                    run('touch {0}.ini'.format(self.project))

                put(StringIO(django_uwsgi_ini), '{0}.ini'.format(self.project), use_sudo=True)

            print(green(' * Installed Uwsgi service in the system.'))
            print(green(' * Done '))
            print()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号