Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I enable the "Upload files to Remote Host" feature in the Before launch section of a PyCharm Run/Debug Configuration?

Tags:

pycharm

I'm running PyCharm Professional 5.0.4 and am referring to the feature described in the documentation here.

Upload files to Remote Host. Select this option to have the application files automatically uploaded to the server according to the default server access configuration. For more information, see Configuring Synchronization with a Web Server and Uploading and Downloading Files.

I have set a default Deployment (SFTP) and its mappings, and I can upload and download files via Tools->Deployment.. I have tried with the remote interpreter set to both the Deployment configuration and SSH Credentials.

I've tried every setting that seems to make sense, but "Upload files to Remote Host" never appears as an option in the Before launch section of my Run/Debug Configuration.

like image 468
user1936123 Avatar asked Feb 08 '16 18:02

user1936123


People also ask

How do I upload files to Pycharm?

Upload a file or folder manuallyIn the Project tool window, right-click a file or folder, then select Deployment | Upload to from the context menu, and choose the target deployment server or server group from the list.

How do I download from Intellij?

Download a file or folderIn the Remote Host tool window, select the required file or folder and choose Download from here from the context menu of the selection.


2 Answers

I have it auto-uploading when I save the project.

File -> Settings -> Build/Execution/Deployment -> Deployment -> Options then about halfway down there's a dropdown to upload changed files automatically to the server either always, on CTRL+S, or never.

Screenshot showing the dropdown mentioned above

In addition to the deployment settings, if you're doing remote interpreting then you'll need to set that up under File -> Settings -> Project: XXX -> Project Interpreter then click the cog in the top-right and choose Add Remote (only available in the Pro version if anyone is wondering).

I think that's all you need.

like image 91
Cameron Avatar answered Nov 17 '22 18:11

Cameron


You can configure to run an external tool before launch using edit configuration window.

Combining it with this https://winscp.net/eng/docs/guide_automation to make batch file that automates file transfers to ftp or sftp servers, you can automate without using pycharm's automatic deployment feature. And here pycharm waits until the execution of external tool finishes to start the execution of the python script.

like image 22
Nipun Sampath Avatar answered Nov 17 '22 19:11

Nipun Sampath