Skip to content

Instantly share code, notes, and snippets.

@scott-coates
Last active August 29, 2015 13:58
Show Gist options
  • Save scott-coates/10144393 to your computer and use it in GitHub Desktop.
Save scott-coates/10144393 to your computer and use it in GitHub Desktop.
Pycharm 3 & IntelliJ 13 don't honor the `working directory` option for remote python consoles. See here: http://youtrack.jetbrains.com/issue/PY-12239
# Go to Settings -> Console -> Python Console (Do not use Django Console - even if you plan to use this with a Django project)
# Ad this gist to the "starting script" option.
import os
# Chdir to "working directory"
os.chdir('/vagrant')
import sys
sys.path.extend([ '/home/vagrant/.pycharm_helpers/pycharm', '/home/vagrant/.pycharm_helpers/pydev'])
import django_manage_shell; django_manage_shell.run("/vagrant")
# Django 1.7 app loading
import django
django.setup()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment