Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7575259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:38:35+00:00 2026-05-30T16:38:35+00:00

I am having issues getting mongodb working with Django, my setup is Mac OS

  • 0

I am having issues getting mongodb working with Django, my setup is Mac OS X 10.7. I followed the tutorial available here: http://django-mongodb.org/topics/setup.html . I have tried with both virtualenv and without (this is my first time installing django so I shouldn’t have any conflicts).

In settings.py

DATABASES = {
   'default' : {
      'ENGINE' : 'django_mongodb_engine',
      'NAME' : 'my_database'
   }
}

In firstapp.models.py

from django.db import models
from djangotoolbox.fields import ListField

class Post(models.Model):
    title = models.CharField()
    text = models.TextField()
    tags = ListField()
    comments = ListField()

In my shell (python manage.py shell), I try running:

from mydjango.firstapp.models import Post
post = Post.objects.create();

But I keep getting the following: DatabaseError: could not connect to localhost:27017: [Errno 61] Connection refused (full traceback)

If I switch settings.py to the following:

DATABASES = {  
    'default': {  
        'ENGINE': 'django_mongodb_engine',  
        'NAME': 'my_database',  
        'USER': '',  
        'PASSWORD': '',  
        'HOST': 'localhost',  
        'PORT': '27017',  
        'SUPPORTS_TRANSACTIONS': False,  
    },  
} 

I get this error in the shell: ImproperlyConfigured: port must be an instance of int

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T16:38:37+00:00Added an answer on May 30, 2026 at 4:38 pm

    Did you setup MongoDB separately? The howto you link doesn’t seem to go over the MongoDB configuration. It assumes the database is already running. In any case MongoDB seems down, or is at least listening somewhere else.

    The last error (“…instance of int”) is just because you specified '27017' (a string) instead of 27017 in the configuration dictionary. But even then it should be equivalent to the first, simpler configuration.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The page I am working with is: http://glenwoodia.com/business-directory I am having issues getting the
I'm working with some OpenGL code for scientific visualization and I'm having issues getting
Having issues getting myself started on MVC3 Trying to define a simple route here
I having issues getting Django to work with settings.py at different location I have
I am having issues getting the network.request function in Corona SDK working with a
I am having issues getting my remove element function working. I have this function:
I'm having issues getting UpdatePanel working in a large, existing solution. I have a
I'm having issues getting my databinding working for a ListBox. I suspect it's because
I am having issues getting this to work, here is what I am trying
I'm having issues getting a simple server/client socket app working in C# between two

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.