推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
magicalchemist
V2EX  ›  Python

Python 项目打包问题请教

  •  
  •   magicalchemist · Jun 28, 2019 · 2637 views
    This topic created in 2514 days ago, the information mentioned may be changed or developed.

    Python 项目用到的模块

    • Django
    • uwsgi
    • nginx
    • mysql 数据库
    • 其他一些包

    虚拟环境是使用 conda 进行导出后再导入到腾讯云服务器上的,但是发现部署的时候 ngixn 和 uwsgi 的配置文件都需要重新改过,mysql 数据库也要拷贝


    想问下有什么打包部署 Python 项目的诀窍吗?

    • 比如 nginx 是在服务器上重新安装的,所以在本地 Ubuntu 上配置的都要重新配下。nginx 等也可以直接打包和项目一起放到服务器吗?
    8 replies    2019-06-28 16:04:54 +08:00
    zyqzyq08
        1
    zyqzyq08  
       Jun 28, 2019 via Android
    docker 一把梭
    ThirdFlame
        2
    ThirdFlame  
       Jun 28, 2019
    docker
    no1xsyzy
        3
    no1xsyzy  
       Jun 28, 2019
    别想了,上 docker 吧
    这本地重新配置也是鬼啊到底配置文件为什么不能复用?
    如果不能复用为什么不用元配置方法写个 bash ?
    0x000007b
        4
    0x000007b  
       Jun 28, 2019 via Android
    Docker 就是干
    qq976739120
        5
    qq976739120  
       Jun 28, 2019
    过来人说句真心话,如果你们的项目 python 版本固定,一台服务器上没有别的语言的项目一起跑,那么怎么搞都行,不然花半天时间试一下 docker,太值得了
    magicalchemist
        6
    magicalchemist  
    OP
       Jun 28, 2019
    @no1xsyzy ngixn.conf 和 uwsgi.ini 等配置文件需要重新修改项目路径,IP 地址等

    多谢各位大佬,明白了,docker 走起。
    superalsrk
        7
    superalsrk  
       Jun 28, 2019
    gunicorn 启服务然后 nginx 反代一下
    donotquestion
        8
    donotquestion  
       Jun 28, 2019
    docker 再用 docker-compose
    超快
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3805 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 00:08 · PVG 08:08 · LAX 17:08 · JFK 20:08
    ♥ Do have faith in what you're doing.