After the new tornado project is created, Pycharm is used as the development tool, and Xshell is used to link the Ubuntu simulation server to facilitate testing. Configure the following aspects before project coding.
1.Free 配置
1.1 Install ssh service
sudo apt-get install openssh-serve
2. Xshell configuration
Download and install the Xshell software and link the virtual machine
3. Need to install the package
3.1 Install virtualenv and virtualenvwrapper
sudo apt-get install python-virtualenv sudo apt-get install virtualenvwrapper
3.2 Configure the virtual environment
3.21. Create a directory to store the virtual environment. All virtual environments created in the future will be placed in the changed directory
mkdir $HOME/.virtualenvs
3.2.2. Modify the configuration file and add a line to ~/.bashrc with vim
export WORKON_HOME=$HOME/.virtualenvs source /usr/local/bin/virtualenvwrappers.sh
3.2.3. Run Configuration File.
source ~/.bashrc
4. Configure Pycharm
4.1. Linking to a virtual machine
1.Tools --> Deployment-->Configuration Click on the + sign Transmission protocol: SFTP 2. Set the synchronization with the code under Windows: Click Mapping, local path, server path 3. Set the synchronization update with the code under Windows Tool-->Deployment-->Options In the upload changed files... option select: on explict save action That is: after the code is modified, ctrl + s can be synchronized to the server
4.2. Using ssh in pycharm
Tool-->start ssh session to use ssh If Chinese garbled characters appear, modify them in the settings: File-->Tools-->SSH Terminal-->Deployment server select username-->Default encoding: utf-8