如何使用 Vagrant 在 Windows 上的 PyCharm 中设置远程调试? [英] How to setup remote debugging in PyCharm on Windows with Vagrant?

查看:37
本文介绍了如何使用 Vagrant 在 Windows 上的 PyCharm 中设置远程调试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经能够在 64 位 Windows 7 上为 Django 项目设置 Vagrant.Vagrant 实例正在使用 postgres 作为后端运行应用程序.我已经设置了端口转发,所以我可以通过本地机器上的浏览器访问.我还在 PyCharm 中设置了远程解释器.但是,我无法弄清楚如何在 PyCharm 3.0 中打开位于 vagrant 实例上的项目.我的本地机器上也有源代码.

I have been able to setup Vagrant on Windows 7 64-bit for a django project. The Vagrant instance is running the application with postgres as backend. I have setup port forwarding, so I am able to access through my browser on local machine. I have also setup remote interpreter in PyCharm. But, I am unable to figure out how to open the project, which is on vagrant instance, in PyCharm 3.0. I also have the source code on my local machine.

有什么想法吗?

谢谢

推荐答案

同步文件夹可能是您正在寻找的东西.

Synced Folders may be something you are looking for.

注意:默认情况下,Vagrant 使用 VirtualBox 的 vboxsf 作为同步文件夹,并将您的项目目录(Vagrantfile 所在的位置)共享到 /vagrant客人.

NOTE: by default Vagrant use VirtualBox's vboxsf for synced folder and share your project directory (where the Vagrantfile resides) to /vagrant within the guest.

然而,vboxsf 存在大量文件和目录的已知性能问题.您可以尝试将项目移动到 /vagrant(或任何同步文件夹),以便主机(Windows 7)和来宾都可以轻松访问该项目.看看它是否运作良好.如果您发现速度缓慢,请尝试移至 NFSsshfs.

However, vboxsf has known performance issues with large number of files and directories. You can try to move the project to /vagrant (or whatever synced folder) so that both the host (Windows 7) and guest can access the project easily. See if it works well. If you see slowness try moving to NFS or sshfs.

参考

这篇关于如何使用 Vagrant 在 Windows 上的 PyCharm 中设置远程调试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆