把django应用 打包 发布成 可独立运行的桌面程序
需求:在pc上运行django+sqlite应用,无须安装django python 数据库 web服务器 。。。
传统django 应用运行在 apache or nginx fastcgi,偽了方便我们用cherrypy来作WEB服务器。
cx_freeze 跨平台的python 打包工具
步骤:
1:下载安装 cx_freeze cherrypy
2 依赖关系 提前导入 项目依赖的包
import django.contrib.auth
import django.contrib.contenttypes
import django.contrib.sessions
import django.contrib.sites
import django.contrib.admin
#these pertain to your application
import subway.models
import subway.views
import urls
import manage
import settings
import django.db.models.sql.compiler
from django.contrib.auth.backends import *
from django.conf.urls.defaults import *
#these
import django.contrib.contenttypes
import django.contrib.sessions
import django.contrib.sites
import django.contrib.admin
#these pertain to your application
import subway.models
import subway.views
import urls
import manage
import settings
import django.db.models.sql.compiler
from django.contrib.auth.backends import *
from django.conf.urls.defaults import *
#these