Pycharm remote code debugging

Sometimes the project deployment will be some bug after the line, then you need to connect to a remote server to debug the code by local pycharm, to see if there is a problem.

step

  1. Open Pycharm local project code -> select Tools -> Deployment -> Configuration ...


    7337727-dd38ffccb72b4e04.png
    step 1
  2. Click + -> select SFTP


    7337727-49677d399d305d73.png
    Step 2
  3. Enter the name of any


    7337727-00b50f897ca6110f.png
    Step 3
  4. Enter the address of the remote server


    7337727-6297d4f10dc419af.png
    Step 4
  5. Switch to the Mappings


    7337727-4aefe4880d37ba64.png
    Step 5
  6. After the configuration looks good


    7337727-2f6b24a5f05fd2c5.png
    Configuring good looks
  7. After the above steps are finished configuring, and most important steps to configure a remote operating environment, otherwise it is impossible to debug remote code. Open Project Interpreter settings


    7337727-2cd27d23085bf859.png
    Step 7
  8. Select SSH Interpreter, set up a remote server address


    7337727-936033158c87eed0.png
    Step 8
  9. Setting up a remote server python path and the project path


    7337727-a00de687055705da.png
    Step 9-1

    7337727-f79663f9fdac1f5a.png
    Step 9-2
  10. Finish


    7337727-63c2a5f01b4d749a.png
    Step 10
  11. Wait for the download of remote dependencies

  12. After the download is complete click Run -> Debug


    7337727-0a23fe7c30e2141b.png
    Step 12
  13. Set Ddit Config ...


    7337727-f5077992e892cc62.png
    Step 13
  14. Setting up a remote domain name server starts Debug


    7337727-d84279a221b23d85.png
    Step 14
  15. Set breakpoints, debug code on a bug in the code


    7337727-e99dd2b9ada222c2.png
    Step 15

    ok, the above steps to complete the configuration Pycharm remote debugging code, now just initiated a request from a bug that will be able to enter the break, pleasant start debugging on the page.

Reproduced in: https: //www.jianshu.com/p/67b747cc07da

Guess you like

Origin blog.csdn.net/weixin_34061555/article/details/91163321