Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyCharm and Django Shell Networking

(My Python is installed via Homebrew and correctly refered to by the preferences as my project interpreter)

I have a problem with PyCharms Django Shell. If I start the django shell, it runs the command (ports are changing):

/usr/local/Cellar/python/2.7.3/bin/python2.7 -u /Applications/PyCharm.app/helpers/pydev/pydevconsole.py 52135 52136

Now, this wont work, it justs states "PyDev Console: starting" and after a while, it stops.

BUT when I'm disabling my Wifi, it works! Now, what could this be?

(I'm running the latest Mountain Lion OSX, firewall disabled, PyCharm 2.5.2, Django 1.4)

like image 742
ruffy Avatar asked Apr 06 '26 16:04

ruffy


2 Answers

It looks like the problem is related to Mac OS DNS resolution specifics. While trying to resolve this problem with @ruffy, what fixed it was changing the LAN DNS server to Google (8.8.8.8).

I've logged this issue in PyCharm tracker so that we can provide a workaround for it in the future updates.

Related topics:

  • Mac OSX Lion DNS lookup order
  • Mac OS X Lion, /etc/hosts Bugs, and DNS Resolution
like image 73
CrazyCoder Avatar answered Apr 12 '26 17:04

CrazyCoder


I had this problem too, but this was caused because my hostname was 'localhost'. Once I changed my hostname to something else (from the sharing section in Preferences) - it worked like a (Py)Charm.

The problem was somewhere in pydev-console, and I don't know why my solution worked - I only guessed it was the problem because originally the console worked, and then it didn't and the only thing had changed was my hostname (due to some fiddling at work)

like image 33
nayyarv Avatar answered Apr 12 '26 17:04

nayyarv



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!