适合ubuntu 系统,不只是树莓派
安装必要软件
pt-get install build-essential psmisc apt-get install python-dev libxml2 libxml2-dev apt-get install python-setuptools cd /opt/ wget http://projects.unbit.it/downloads/uwsgi-latest.tar.gz tar -zxvf uwsgi-latest.tar.gz mv uwsgi-latest/ uwsgi/ cd uwsgi/ python setup.py install
安装nginx/安装mysql
apt-get install mysql-server apt-get install nginx
安装uwsgi,阿里源带了uwsgi这里直接安装
apt-get install uwsgi uwsgi-core uwsgi-plugin-python
安装django
apt-get install python-django python-mysqldb
配置
cat /etc/uwsgi/apps-enabled/www.ini
[uwsgi] socket = 192.168.0.14:9000 #这里可以改成socket,/var/run/uwsgi/app/www/socket chmod-socket = 667 limit-as = 256 processes = 4 master = true daemonize = /var/log/uwsgi.log enable-threads = true vacuun = true chdir = /var/www/html/testp/mysite #django 项目目录 module = mysite.wsgi #创建完项目后会在mysite侠自动生成wsgi.py ####说明module 配置######tree /var/www/html/testp/mysite//var/www/html/testp/mysite/├── manage.py└── mysite ├── __init__.py ├── __init__.pyc ├── settings.py ├── settings.pyc ├── urls.py ├── wsgi.py └── wsgi.pyc
时间: 2024-10-06 06:33:00