1.安装requirements.txt
sudo pip install -r requirements.txt
2.配置settings.py文件
DATABASES = {
‘default‘: {
‘ENGINE‘: ‘django.db.backends.mysql‘,
‘NAME‘: ‘test‘,
‘USER‘: ‘root‘,
‘PASSWORD‘: ‘root‘,
‘HOST‘: ‘localhost‘,
‘PORT‘: ‘3306‘,
}
}
3.同步数据库
python manage.py syncdb
4.有些项目需要安装grunt
sudo npm install -g grunt(-g代表全局)
在first-angular(包含package.json,gruntfile)中运行npm install, grunt
5.python manage.py runserver 127.0.0.1:8000
6.nginx反向代理
server{
listen 80;
server_name 127.0.0.1;
access_log /var/log/nginx/blog.hysia.com-access.log;
error_log /var/log/nginx/log.hysia.com-com-error.log;
root /var/wwww/zarpe-sms;
index index.html index.htm;
location / {
try_files $uri/ /index.html;
}
location /static {
root /var/www/zarpe-scrs-backend/;
}
location /api {
proxy_pass http://127.0.0.1:8000;
}
}
kill 23734
$ lsof -i:80
原文:http://my.oschina.net/u/2002748/blog/398302