ubuntu 部署Django

1, 安装python包管理工具easy_install。

sudo apt-get install python-setuptools

2,安装Django。

  sudo easy_install "django==1.6"

 3,安装C/C++库和编译器。

   sudo apt-get install gcc 

  sudo apt-get install build-essential

4,安装 Apache2与 mod-wsgi。

sudo apt-get install apache2

sudo apt-get install libapache2-mod-python

sudo apt-get install libapache2-mod-wsgi

5,安装PIL库。

  sudo apt-get install python-imaging

6,安装rest-framework。

  sudo easy_installdjangorestframework

7,修改Apache2配置文件 /etc/apach2/apache.conf

 

8,配置admin静态文件。
  配置STATIC_URL和STATIC_ROOT
  python manage.py collectstatic
 
9,安装配置MySQL。
  安装:
  sudo apt-get install mysql-server
  sudo apt-get install python-mysqldb
  配置:在mysql命令行中创建Django需要使用的数据库文件。
    创建数据库文件注意指定数据库字符集:
  UTF8: CREATE DATABASE tinyCMS DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;表示大小写不敏感;
  UTF8: CREATE DATABASE tinyCMS DEFAULT CHARACTER SET utf8 COLLATE utf8_general_cs;表示大小写敏感。
 
原文地址:https://www.cnblogs.com/nigang/p/3996355.html