bobsr
bobsr

Reputation: 3965

ImproperlyConfigured at / port must be an instance of int django mongodb

Trying to move Django-MongoDB developement environment to production

Keep getting the following error from web interface:

    ImproperlyConfigured at /
    port must be an instance of int

On terminal, if I run

    python manage.py syncdb


    File "/home/user/lib/python-environments/djangomongo/local/lib/python2.7/site-packages/pymongo/connection.py", line 209, in __init__
        raise TypeError("port must be an instance of int")
    django.core.exceptions.ImproperlyConfigured: port must be an instance of int

Upvotes: 1

Views: 3180

Answers (3)

harsh tibrewal
harsh tibrewal

Reputation: 835

I faced this while using environment variables. They are injected as strings. You need to cast port as int to get going.

Upvotes: 0

statguy
statguy

Reputation: 1717

I don't have a 100% working system yet, but the issue here is the incompatibility between your version of django-nonrel and pymongo. For the django-nonrel branching off of django 1.3, I needed to use pymongo 1.11 (not sure if any 2.X of pymongo would work).

Upvotes: 0

Brian Cajes
Brian Cajes

Reputation: 3402

Double check how you set up you setup your pymongo Connection object: http://api.mongodb.org/python/current/api/pymongo/connection.html Judging from just the error message you seem to have an incorrect port parameter. I'm also guessing that if it worked in devel and not in production, you are missing some configuration values in prod.

Upvotes: -1

Related Questions