You say you imported the database. Did you use syncdb to set up the tables?
It sounds like your comment_id field in MySQL is not set as an
auto-incrementing primary key field. Do you have access to that MySQL
database to check, and or update that field definition?


On Wed, Apr 9, 2014 at 2:42 PM, Adam Teale <[email protected]> wrote:

> Hi Guys
>
> I have been working on a django app that was going well using an sqlite db.
> I've moved it over to mysql and imported the database
>
> Everything looks good
>
> But when I try to use the django comment system that was working well on
> the sqlite db before I get:
>
> OperationalError at /comments/post/
> (1364, "Field 'id' doesn't have a default value")
> Request Method: POST
> Request URL: http://192.168.1.143/comments/post/
> Django Version: 1.6.2
> Exception Type: OperationalError
> Exception Value:
> (1364, "Field 'id' doesn't have a default value")
> Exception Location: 
> /Users/admin/Dropbox/mstudio/code/mBrain/mbrain/venv/lib/python2.7/site-packages/MySQLdb/connections.py
> in defaulterrorhandler, line 36
> Python Executable:
>
>
> I'm a little lost - do i need to set a default value for
> the django.contrib.comments model?
> And how would i do that if I needed to - this has an Object ID field - i
> don't know how I'd set that up
>
>
> Any ideas? What am i missing?
>
> Many thanks!
>
> Adam
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/18894c72-24c9-41cd-85a1-4dc09072dfb8%40googlegroups.com<https://groups.google.com/d/msgid/django-users/18894c72-24c9-41cd-85a1-4dc09072dfb8%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACMDPqHbdXorWvLLc%2BDy3eEdvd9Q7gaK6-aCqzuG_X9HvSjz%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to