PyCharm in Windows7 + Virtualbox Ubuntu - guide to a common setup?

I'm trying to just get started with a simple django project. I run PyCharm in Windows, and deploy my code to an Ubuntu virtualbox with which I've shared my local projects folder. I know this is not an uncommon setup, but I cannot seem to find any sort of "official" guide, and although I've got a remote interpreter set up, I still don't seem to have things "right" yet.

  • Settings | Python Interpreters: I've created an entry here, and configured it to use the python executable in my virtualen (~/ve/test_ve/bin/python), and I copied the pycharm helpers to ~/pycharmhelpers. Tested the connection, it's all good. In the packages tab, it lists both Django & MySQL-python (which I installed via pip install earlier)
  • Settings | Django Support: I've got the "Enable..." checkboix ticked, he project root is set to the Windows path of my project root, the folder which contains manage.py & settings.py, and those are both set directly beneath.
  • Console | Python console: the only thing set here is the python interpreter, the other options are all blank. (path mappings - should i set that?)
  • Settings | Django Console: same as for the python console.

And so where I'm at currently is that I can run (shift+10) my project, and it starts the server on the ubuntu box, and loads it up in my browser - all fine. However, under the "Tools" menu, things get a bit more muddled. First off, the options for "Django Console" and "Run manage.py task" are both greyed-out/unavailable. I can run the Python console, and it does indeed open up a session with the remote interpreter I've configured for this project... but in the interpreter, it first runs  "sys.path.extend(['L:\\djangotest']), which is not appropriate of course. Nonetheless, it is running python on the remote box.

So aside from not being able to run tasks, in the code editor I get a lot of errors/underlined text complaining about "Unresolved reference", about literally every single thing in the script.

So perhaps I have a fundamental expectation wrong: I was hoping not to install python on my Windows 7 machine, where I'm actually running PyCharm - I figured it'd be enough to just have it on my local development server, which is where the code will be running. Is that wrong? Also, is there a walk-through for us Windows + Virtualbox users? Thanks in advance.
5 comments
Comment actions Permalink
I've generally found it to be the path of least resistance to use a Ubuntu desktop so I can fully develop inside the VM. The performance overhead wasn't too bad on my Windows 7 notebook compared to running just a server but YMMV.
0
Comment actions Permalink
I'm also looking for how to be able to remote debug my Django application–Win 7 desktop with a CentOS server. The available documentation and settings options only seem friendly to either remote debug or Django, not both. Could this be added to the help?
0
Comment actions Permalink
Remote debugging Django is not really different from debugging any other kind of application. You need to configure a remote interpreter in Settings | Python Interpreters, set up the mappings and use the "Django Server" run configuration to start the debugger.
0
Comment actions Permalink
Django Server


Using the Django server settings with the remote interpreter and remote mapped paths, it still appears to be using the local Windows path instead of the remote Linux path.  I would expect it to try to use the remote path for the remote interpreter?

image1


image2
0

Please sign in to leave a comment.