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

  • Home
  • SEARCH
  • 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 7970367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:23:17+00:00 2026-06-04T07:23:17+00:00

I have a database tumblelog (using mongoengine) in which I added some data in

  • 0

I have a database “tumblelog” (using mongoengine) in which I added some data in the “user” collection with a “User” model:

db.user.find()

...
{ "_id" : ObjectId("4fb0c9494ca88402dd000000"), "_types" : [ "User" ], "first_name" : "John", "last_name" : "Doe", "_cls" : "User", "email" : "jdoe@example.com" }
{ "_id" : ObjectId("4fb0cb9d4ca88402ec000000"), "_types" : [ "User" ], "first_name" : "Joe30", "last_name" : "Foe", "_cls" : "User", "email" : "hu@huu.com" }

When I try User.objects in a django shell, I get the following error:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File ".../mongoengine/queryset.py", line 1127, in __getitem__
     return self._document._from_son(self._cursor[key])
  File ".../mongoengine/base.py", line 1018, in _from_son
     obj = cls(**data)
  TypeError: __init__() keywords must be strings

Same thing when I try

for user in User.objects:
    print user.first_name

—- Edit —-

I tried this

>>> users = User.objects
>>> users.count()
7
>>> users.first()
...
TypeError: __init__() keywords must be strings

—- Edit 2 —-

I installed my project this way :

> virtualenv Test
> source Test/bin/activate
> pip install Django
> pip install mongoengine
> cd Test/
> django-admin.py startproject db

Then I added the lines

from mongoengine import *
connect('tumblelog')

in settings.py
then I created this simple model

from mongoengine import *

class User(Document):
email = StringField(required=True)
name = StringField(max_length=50)

then I run the server

> python manage.py runserver

And in the shell (python manage.py shell) I can save data if I import my model class but I can’t read it, I always have the same TypeError: init() keywords must be strings !

—–Switching to django-mongodb engine—-

I didn’t find any solution so I will use django-mongodb-engine. I did not find any comparison, but I tried both and it’s very similar.
I just regret django-mongodb-engine doesn’t handle inheritance principle.

What am I doing wrong ?
Thanks in advance!

  • 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-06-04T07:23:18+00:00Added an answer on June 4, 2026 at 7:23 am

    we had the exact same issue using mongoengine 0.6.9. I am not suggesting this as an ideal solution but downgrading to 0.6.5 resolved this issue for us.

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

Sidebar

Related Questions

i have database from which i get data to my C# app using SQL
I have database in which data is imported from the other table. if data
i have database table with few text fields which i use to filter data
I have database application, I want to allow the user to restore the deleted
I have database table Inbox(id,accountid,emailfrom,emailsubject,emailbody, recieveddate,attachment, read(bool) i have added it to the form
I have Database mirroring setup between two SQl 2005 servers (no witness). Using Tsql,
I have database with a column name State/Province. All the queries and data transfers
I have Database table and I am using SQL Server 2008. The table contins
I have database table with the follwoing fields: id, loan_no, installment, status which has
I have database of ship hom whicn I wand to select data from my

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.