Skip to content

PyCharm and Vagrant

espenja edited this page Oct 30, 2013 · 1 revision

PyCharm

PyCharm is an IDE mainly for coding Python, and it comes with integrated Django-support.
Take a look at the video - this is a really great IDE.
Vagrant-support for our setup is a bit tricky if you've never done it before, hence this guide.


Notes

For the course of this tutorial C:\Users\Espen\pycharmsetup\onlineweb4 will be used as the path in which onlineweb4 was cloned to. Replace every occurence of this string with the path you cloned to.

PyCharm likes Vagrant being started from within PyCharm. Do this before proceeding:

  • If you started Vagrant already:
  • Tools -> Vagrant -> Halt
  • Tools -> Vagrant -> Up

Starting off

Fire up an instance of PyCharm, click the File-menu and Open Directory....
Choose the folder in which you cloned onlineweb4 and click OK.

Your PyCharm should look like this:

Step1


Django support

Press ctrl-alt-s to bring up the Settings dialog.
Edit the Django Support page:

Step 2


Python Interpreters

Open the Project Interpreter -> Python Interpreters page: Add a new Remote interpreter:

Step 3

Make sure things look like this:

Step 4

Press Apply and OK to save your settings.


Editing Run Configurations

Step 5

Press the green plus sign and select Django server.

Make sure the settings look like this: Step 6

This is the most fucked up step to realize at first, you have to map the paths of your Host OS to the paths of your Guest OS:

Click ... right of Environment variables and make sure this is correct:

Step 7

Next: ... right of Path mappings:

Step 8


That should be it. Click Apply and OK. Now press the green run arrow to run onlineweb4.