pyinstaller 打包django1.8

  1. 首先下载pyinstaller最新开发版。稳定版暂时有些问题(root用户)

    pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip

  2. 切换到普通用户,新建django 项目并试运行保证django项目是OK的。

    pip install django==1.8.3

    django-admin startproject mysite

    python manage.py migrate

    python manage.py createsuperuser

    pyinstaller 打包django1.8_第1张图片

  3. 使用pyinstaller 打包该工程

    pyinstaller --name mysite/manage.py

  4. 用打包后的二进制文件运行并保存

    打包后的工程在dist/mysite/mysite

    pyinstaller 打包django1.8_第2张图片

    ./mysite runserver 192.168.1.241:8000

    pyinstaller 打包django1.8_第3张图片

        到现在编译打包就算完成了。在windows平台执行也是OK的,这里就不演示了。这也是由于客户个别需求不希望让客户看到源码才这样做的。

你可能感兴趣的:(django,pyinstaller,打包python)