PyOne2.0更新-更方便的验证方式&支持多种视频格式播放

PyOne喜迎2.0版本:

  1. 验证方式更方便、更快捷
  2. 支持个人版账号,同时不再支持世纪互联版账号
  3. 支持avi、wmv等格式视频播放

PyOne介绍

  1. onedrive列表程序,可用于更好的分享文件
  2. 基于Flask开发,Python是最好的语言demo展示:https://pyone.me (别问我密码)

安装前提

  1. 只支持onedrive商业版、教育版、个人版,不再支持世纪互联版
  2. 涉及的东西较多,不熟悉linux操作但是想安装的,多操作几遍

升级教程

  • 如果是1.0版本升级2.0,那么直接重新安装
  • 如果是小版本更新,则可以按照以下流程进行更新代码
    • 先将data目录和config.py复制出去
    • 删除原来的PyOne源码
    • 重新git clone一份PyOne源码
    • 将原来的data目录替换新源码的data目录,原来的config.py替换新源码的config.py
    • 重新安装依赖,看是否有新增的依赖包: pip install -r requirements.txt
    • 重启网站: supervisorctl -c supervisord.conf restart pyone
    • 最好更新一下文件缓存: python function.py UpdateFile

安装教程

1. 准备工作

环境要求:centos7+python2.7安装宝塔面板:http://bt.cn在宝塔面板安装:redis、mongodb、nginx源码下载到本地:

git clone https://github.com/abbeyokgo/PyOne

修改源码下的config.py文件:

修改config_dir为当前源码目录绝对路径

2. 开始安装

  • 安装依赖环境:
cd PyOne && wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py && pip install -r requirements.txt
  • 试运行,在源码根目录下运行
gunicorn -k eventlet -b 0.0.0.0:34567 run:app

然后试着访问:http://ip:34567 看看能正常显示?如果不能,请在宝塔开启端口,还不行请看错误内容

  • 修改nginx配置

假设你已经将域名解析到你的服务器了,然后在宝塔添加了域名,那么只需要在宝塔修改nginx配置

网站管理-点击域名-反向代理,反向代理:http://127.0.0.1:34567

TIM截图20180913191350.png

保存之后,应该就可以通过域名访问了

注意!为了后台功能的正常使用,反向代理之后,需要修改nginx配置

如图,添加两行,再保存

location / 
    {
        ...

        proxy_buffering off;
          proxy_cache off;

        ...
    }

TIM截图20180913191714.png

  • 授权

紧接着上一步,就能直接授权了

1.png 2.png 3.png 4.png

3. 配置开机启动

网站源码下有个 supervisord.conf,主要内容如下:

[program:pyone]
command = gunicorn -k eventlet -b 0.0.0.0:34567 run:app
directory = /root/pyone
autorestart = true

主要修改两个地方:

  1. 端口号:即34567那个端口号,修改为自己选的,或者不改动
  2. 源码目录:directory修改为你选的网站目录

修改之后运行下面的命令,设置开机启动

echo "supervisord -c 源码目录/supervisord.conf" >> /etc/rc.d/rc.local
chmod +x /etc/rc.d/rc.local

重启生效。

本次不用重启生效的方法:

supervisord -c 源码目录/supervisord.conf

高级使用

带你玩转PyOne:onedrive列表工具(二、使用篇)

带你玩转PyOne:onedrive列表工具(三、后台管理篇)

提供安装服务

点击购买

本文作者:Abbey

本文链接:https://www.abbeyok.com/archives/70

版权声明:本博客所有文章除特别声明外,均采用CC BY-NC-SA 3.0许可协议。转载请注明出处!

【开源】基于有赞开发的要饭系统... <<
44 条评论
  1. author
    2019-05-27
    Abbey
    2019-05-27
    Kiriki
    [2019-05-27 00:43:33...

    你的self_config.py文件掉了

  2. author
    2019-05-27
    Kiriki

    [2019-05-27 00:43:33 +0000] [11034] [INFO] Starting gunicorn 19.9.0
    [2019-05-27 00:43:33 +0000] [11034] [INFO] Listening at: http://0.0.0.0:34567 (11034)
    [2019-05-27 00:43:33 +0000] [11034] [INFO] Using worker: eventlet
    [2019-05-27 00:43:33 +0000] [11043] [INFO] Booting worker with pid: 11043
    [2019-05-27 00:43:33 +0000] [11043] [ERROR] Exception in worker process
    Traceback (most recent call last):
    File "/usr/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
    worker.init_process()
    File "/usr/lib/python2.7/site-packages/gunicorn/workers/geventlet.py", line 102, in init_process
    super(EventletWorker, self).init_process()
    File "/usr/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
    self.load_wsgi()
    File "/usr/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
    self.wsgi = self.app.wsgi()
    File "/usr/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
    File "/usr/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
    return self.load_wsgiapp()
    File "/usr/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
    return util.import_app(self.app_uri)
    File "/usr/lib/python2.7/site-packages/gunicorn/util.py", line 350, in import_app
    import(module)
    File "/www/wwwroot/PyOne/run.py", line 6, in
    from app import create_app
    File "/www/wwwroot/PyOne/app/init.py", line 4, in
    from config import config
    File "/www/wwwroot/PyOne/config.py", line 2, in
    from self_config import *
    ImportError: No module named self_config
    [2019-05-27 00:43:33 +0000] [11043] [INFO] Worker exiting (pid: 11043)
    [2019-05-27 00:43:33 +0000] [11034] [INFO] Shutting down: Master
    [2019-05-27 00:43:33 +0000] [11034] [INFO] Reason: Worker failed to boot.

  3. author
    2018-11-13
    你是

    播放器用的是dplayer还是ckplayer?

  4. author
    2018-11-10
    Abbey
    2018-11-10
    稻草V
    已经好了,现在有个问题,只能手动命令更新...

    你说的这个问题我无法复现

  5. author
    2018-11-10
    稻草V
    2018-11-09
    Abbey
    data/下的文件全删了,重新走一遍流程...

    已经好了,现在有个问题,只能手动命令更新,后台点击更新缓存就跳到登录页

  6. author
    2018-11-09
    Abbey
    2018-11-09
    稻草V
    换服务器后不能重新绑定,不能更新缓存ge...

    data/下的文件全删了,重新走一遍流程

  7. author
    2018-11-09
    稻草V

    换服务器后不能重新绑定,不能更新缓存
    getting files from url https://graph.microsoft.com/v1.0/me/drive/root/children?expand=thumbnails
    error:CompactToken parsing failed with error code: 80049217! waiting 180s

  8. author
    2018-11-09
    Abbey
    2018-11-09
    稻草V
    换服务器,在新机器装无法启动了。[roo...

    config.py 最后面添加一行:
    tj_code=''
    然后supervisorctl -c supervisord.conf restart pyone 重启网站

  9. author
    2018-11-09
    稻草V

    换服务器,在新机器装无法启动了。
    [[email protected] PyOne]# gunicorn -k eventlet -b 0.0.0.0:34567 run:app
    [2018-11-09 13:57:25 +0000] [2533] [INFO] Starting gunicorn 19.9.0
    [2018-11-09 13:57:25 +0000] [2533] [INFO] Listening at: http://0.0.0.0:34567 (2533)
    [2018-11-09 13:57:25 +0000] [2533] [INFO] Using worker: eventlet
    [2018-11-09 13:57:25 +0000] [2540] [INFO] Booting worker with pid: 2540
    [2018-11-09 13:57:25 +0000] [2540] [ERROR] Exception in worker process
    Traceback (most recent call last):
    File "/usr/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
    worker.init_process()
    File "/usr/lib/python2.7/site-packages/gunicorn/workers/geventlet.py", line 102, in init_process
    super(EventletWorker, self).init_process()
    File "/usr/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
    self.load_wsgi()
    File "/usr/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
    self.wsgi = self.app.wsgi()
    File "/usr/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
    File "/usr/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
    return self.load_wsgiapp()
    File "/usr/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
    return util.import_app(self.app_uri)
    File "/usr/lib/python2.7/site-packages/gunicorn/util.py", line 350, in import_app
    import(module)
    File "/www/wwwroot/fakeox_com/PyOne/run.py", line 506, in
    app.jinja_env.globals['tj_code']=tj_code if tj_code is not None else ''
    NameError: name 'tj_code' is not defined
    [2018-11-09 13:57:25 +0000] [2540] [INFO] Worker exiting (pid: 2540)
    [2018-11-09 13:57:26 +0000] [2533] [INFO] Shutting down: Master
    [2018-11-09 13:57:26 +0000] [2533] [INFO] Reason: Worker failed to boot.

  10. author
    2018-11-02
    Abbey
    2018-11-02
    sxgpyjg
    怎么装到虚拟主机上 乐云空间...

    不能虚拟空间,至少得是vps

请先登陆注册

已登录,注销 取消