ElectronAnt
ElectronAnt

Reputation: 2195

Mongo working with Django max_length issue for CharField

I'm having problems with getting Django to work with MongoDB. So when I work in a Django shell I get no errors and can query and add things to my database.

The problem comes when I run 'python manage.py runserver'. When I do this, I get the following errors:

patientapp.patient: "first_name": CharFields require a "max_length" attribute that is a positive integer.

This is strange because in this tutorial, they don't give CharField a max length:

http://django-mongodb.org/tutorial.html

Any ideas?

Upvotes: 1

Views: 621

Answers (1)

Jonas H.
Jonas H.

Reputation: 2491

Probably because runserver invokes schema validation and shell doesn't, and a CharField without max_length isn't a valid in a Django schema. Looks like a bug in the tutorial, patches welcome.

Upvotes: 1

Related Questions