Local pycharm remotely connects to the server to run your own project

configure server

  1. Open pycharm and find Tools–>Deployment–>Configuration
    Insert image description here

  2. Enter the configuration page, click the plus sign in the upper left corner, and select SFTP
    Insert image description here

  3. An input box will pop up, enter your customized server name.
    Insert image description here

  4. Click the omit option after ssh configuration
    Insert image description here

  5. Enter the server configuration page.
    Insert image description here
    If the connection is successful, click Apply, then click OK.

  6. Set the project mapping
    Insert image description here
    and click OK. The server will be configured.

  7. Select the server we just configured for the project, click "No default server" in the lower right corner of the page, and then the server "image" we configured above will appear, select
    Insert image description here

Configure the python interpreter

After the server is configured, you need to set up the corresponding server python environment for the project, which is what we call the python interpreter.

  1. Click File–>Settings to open the settings interface
    Insert image description here

  2. Find the python interpreter under the project
    Insert image description here

  3. Find Add Interpreter and select SSH
    Insert image description here

  4. Select existing, then select configuration. There will be server options we configured before, select and next step.
    Insert image description here

  5. Next step
    Insert image description here

  6. Configure python environment
    Insert image description here

  7. Click Apply and OK, our interpreter is set up.
    Insert image description here
    Then, we can run our own project locally on the server.

  8. code update
    Insert image description here

Guess you like

Origin blog.csdn.net/David_house/article/details/132123823