6.15 JLL--实习日志--SetupNewWorkSpace on cloud9

来源:互联网 发布:台湾经济 知乎 编辑:程序博客网 时间:2024/05/21 18:37

On Cloud9 IDE:
Set RSA in cloud9 and github setting before setup.
*cloud9 has already done the install
**may need to modify accordingly
1. use Django template in cloud9, create a new work space, init with Github repository:
手动pull repository 下来, 这边需要一开始的时候就指定Github repository ,也可以在后面创建!!!这边需要注意的,gitHub clone的时候需要使用 git@github.com:LeonGhibli/horizon.git 的方式,另外一种是https 的方式

  1. Update apt source: 更新环境
    sudo apt-get update

  2. Install git: 安装git 方式
    sudo apt-get install git

!warning: git-daemon: unable to open supervise/ok: file does not exist

  1. Checkout a new branch from major branch and start your working**
git checkout -b YOUR_BRANCH_NAME
  1. Install mysql:**
错误版本 sudo apt-get install mysql

参考版本
ubunta下安装mysql的步骤

sudo apt-get install mysql-serversudo mysql_secure_installation

报错: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111)
装完以后重新起mysql 服务: sudo service mysql restart

  1. Set root password for mysql:
mysqladmin -u root password Admin12#
  1. Install python-dev*:
sudo apt-get install python-dev

python-dev这个是什么鬼?

  1. Install uwsgi
    sudo pip install uwsgi

  2. Install nginx*
    sudo apt-get install nginx

  3. Link horizon_nginx config 软连接

sudo ln -s /home/ubuntu/workspace/horizon/horizon_nginx.conf /etc/nginx/sites-enabled/
如果没有对应home/ubuntu/workspace/horizon/horizon_nginx.conf或者是位置发生错误,他会自动在/etc/nginx/sites-enabled/ 位置上建立一个空的horizon_nginx.conf ,
创建一个空的horizon_nginx.conf ,并且把
nano命令行+’-s’
ln: failed to access ‘–s’: No such file or directory
ln: failed to access ‘/home/Ubuntu/workspace/horizon/horizon_nginx.conf’: No such file or directory

  1. Install middlewares
sudo pip install Django-axessudo pip install Django-bootstrap-toolkit!
  1. sudo pip install mysql-python
  2. sudo pip install django-excel
  3. sudo pip install pyexcel-xls
  4. sudo pip install pyexcel-xlsx
  5. sudo pip install python-pptx
  6. Restart your workspace
    点击 右上角 memory—cpu—Restarted

  7. Restart service if necessary
    sudo service mysql restart
    sudo service nginx restart

  8. Pull up Horizon service:
    uwsgi –socket horizon.sock –module horizon.wsgi –chmod-socket=777

  9. Modify mysql character setting to support utf-8:*
    在第三步结束后,删除原来的数据库,创建一个新的数据库,和之前同名的数据库,只是类型变成了utf-8
    修改数据库默认的类型,改称utf-8

修改mysql 数据库的名称
https://www.centos.bz/2013/09/quick-and-secure-modify-mysql-name/

!!!!!!!!!!————–!!!!!!——–删除migration 文件下下面所有的记录!!—————-!!再三确认以后再操作一下步骤!!血泪教训啊!否则你你也会回来加这一行的!!!
!!!!!!!!!!———–>!!!!! 一定要删啊!!!!—————

  1. python manage.py makemigrations
  2. python manage.py migrate

  3. Create super user
    python manage.py createsuperuser (leon )

  4. Login Django-admin

  5. Login Horizon

  6. Checkout a new branch from major branch and start your working**
    git checkout –b YOUR_BRANCH_NAME
  7. Add your work to be tracked in local branch**
    git add .
  8. Commit your work in local**
    git commit –m “20170302”
  9. Push your work to github
    git push
  10. Team review and merge code

  11. Change SSH for you own account!

原创粉丝点击