title: Django - MongoDB: (could not connect to localhost:27017) Connection refused
body: <p>I am having issues getting mongodb working with Django, my setup is Mac OS X 10.7. I followed the tutorial available here: <a href="http://django-mongodb.org/topics/setup.html" rel="nofollow">http://django-mongodb.org/topics/setup.html</a> . I have tried with both virtualenv and without (this is my first time installing django so I shouldn't have any conflicts).</p>
  
  <p>In settings.py </p>
  
  <pre><code>DATABASES = {
     'default' : {
        'ENGINE' : 'django_mongodb_engine',
        'NAME' : 'my_database'
     }
  }
  </code></pre>
  
  <p>In firstapp.models.py</p>
  
  <pre><code>from django.db import models
  from djangotoolbox.fields import ListField
  
  class Post(models.Model):
      title = models.CharField()
      text = models.TextField()
      tags = ListField()
      comments = ListField()
  </code></pre>
  
  <p>In my shell (python manage.py shell), I try running: </p>
  
  <pre><code>from mydjango.firstapp.models import Post
  post = Post.objects.create();
  </code></pre>
  
  <p>But I keep getting the following: <strong>DatabaseError: could not connect to localhost:27017: [Errno 61] Connection refused</strong> (<a href="http://pastebin.com/QEvvfSAd" rel="nofollow">full traceback</a>)</p>
  
  <p>If I switch settings.py to the following: </p>
  
  <pre><code>DATABASES = {  
      'default': {  
          'ENGINE': 'django_mongodb_engine',  
          'NAME': 'my_database',  
          'USER': '',  
          'PASSWORD': '',  
          'HOST': 'localhost',  
          'PORT': '27017',  
          'SUPPORTS_TRANSACTIONS': False,  
      },  
  } 
  </code></pre>
  
  <p>I get this error in the shell: <strong>ImproperlyConfigured: port must be an instance of int</strong></p>