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.
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With