django 1.6 采用mysql数据库,表同步失败。

我的modles代码如下:

 #coding:utf-8
'''
Created on 2013-11-11
@author: Administrator
'''
from __future__ import unicode_literals
from django.db import models
import time

class FaqCategory(models.Model):
    id = models.AutoField(primary_key=True)
    catname = models.CharField(max_length=150L, blank=True)
    class Meta:
        db_table = 't_faq_category'
        verbose_name = u'faq_category'
        verbose_name_plural = u'faq_category'
        app_label = u'My_Category'
    def __unicode__(self):
        return self.catname

class ProductCategory(models.Model):
    id = models.AutoField(primary_key=True)
    catname = models.CharField(max_length=150L, blank=True)
    class Meta:
        db_table = 't_product_category'
        verbose_name = u'product_category'
        verbose_name_plural = u'product_category'
        app_label = u'My_Category'
    def __unicode__(self):
        return self.catname

class ServiceCategory(models.Model):
    id = models.AutoField(primary_key=True)
    catname = models.CharField(max_length=150L, blank=True)
    class Meta:
        db_table = 't_service_category'
        verbose_name = u'service_category'
        verbose_name_plural = u'service_category'
        app_label = u'My_Category'
    def __unicode__(self):
        return self.catname

class AboutCategory(models.Model):
    id = models.AutoField(primary_key=True)
    catname = models.CharField(max_length=150L, blank=True)
    class Meta:
        db_table = 't_about_category'
        verbose_name = u'about_category'
        verbose_name_plural = u'about_category'
        app_label = u'My_Category'
    def __unicode__(self):
        return self.catname

class DownloadCategory(models.Model):
    id = models.AutoField(primary_key=True)
    catname = models.CharField(max_length=150L, blank=True)
    class Meta:
        db_table = 't_download_category'
        verbose_name = u'download_category'
        verbose_name_plural = u'download_category'
        app_label = u'My_Category'
    def __unicode__(self):
        return self.catname

class Announcement(models.Model):
    id = models.IntegerField(primary_key=True)
    title = models.CharField(max_length=100L , blank = False , verbose_name = "Title")
    content = models.TextField( blank = False , verbose_name = "Content")
    createddate = models.DateField(null=True, db_column='createdDate', blank=True , default=time.strftime('%Y-%m-%d'),verbose_name='Date')
    class Meta:
        db_table = u't_announcement'
        verbose_name = u'announcement'
        verbose_name_plural = u'announcement'
        app_label = u'My_Company'

class Products(models.Model):
    id = models.IntegerField(primary_key=True)
    catid = models.ForeignKey(ProductCategory,db_column= 'catid',to_field='id',blank=False,verbose_name = 'catid') 
    product_name = models.CharField(max_length=200L , verbose_name = "Name")
    product_simple_desc = models.TextField(blank=True , verbose_name = "Simple Desc")
    product_full_desc = models.TextField(blank=True , verbose_name = "Full Desc")
    product_pic = models.CharField(max_length=200L, blank=True , verbose_name = "Picture Path")
    product_order = models.IntegerField(verbose_name = "Order")
    createddate = models.DateField(db_column='createdDate', blank=True , default=time.strftime('%Y-%m-%d') , verbose_name = "Created Date") # Field name made lowercase. This field type is a guess.
    class Meta:
        db_table = 't_products'
        verbose_name = u'products'
        verbose_name_plural = u'products'
        app_label = u'My_Company'

class News(models.Model):
    id = models.AutoField(primary_key=True)
    title = models.CharField(max_length=255L, blank=True ,verbose_name = "Title")
    content = models.TextField(blank=True , verbose_name = "Content")
    createddate = models.DateField(null=True, db_column='createdDate', blank=True , default=time.strftime('%Y-%m-%d') , verbose_name = "Created Date") # Field name made lowercase.
    class Meta:
        db_table = 't_news'
        verbose_name = u'news'
        verbose_name_plural = u'news'
        app_label = u'My_Company'

class Download(models.Model):
    id = models.AutoField(primary_key=True)
    catid = models.ForeignKey(DownloadCategory,db_column= 'catid',to_field='id',blank=False,verbose_name = 'catid') 
    title = models.CharField(max_length=150L, blank=True)
    content = models.TextField(blank=True)
    downloadurl = models.CharField(max_length=200L, blank=True)
    createddate = models.DateField(null=True, db_column='createdDate', blank=True) # Field name made lowercase.
    class Meta:
        db_table = 't_download'
        verbose_name = u'download'
        verbose_name_plural = u'download'
        app_label=u"My_Company"

class Faq(models.Model):
    id = models.AutoField(primary_key=True)
    catid = models.ForeignKey(FaqCategory,db_column= 'catid',to_field='id',blank=False,verbose_name = 'catid')    
    title = models.CharField(max_length=150L, blank=True ,verbose_name = 'title')
    content = models.TextField(blank=True,verbose_name = 'content')
    class Meta:
        db_table = 't_faq'
        verbose_name = u'faq'
        verbose_name_plural = u'faq'
        app_label=u"My_Company"

class Service(models.Model):
    id = models.AutoField(primary_key=True)
    catid = models.ForeignKey(ServiceCategory,db_column= 'catid',to_field='id',blank=False,verbose_name = 'catid') 
    title = models.CharField(max_length=150L, blank=True)
    content = models.TextField(blank=True)
    class Meta:
        db_table = 't_service'
        verbose_name = u'service'
        verbose_name_plural = u'service'
        app_label=u"My_Company"

class About(models.Model):
    id = models.AutoField(primary_key=True)
    catid = models.ForeignKey(AboutCategory,db_column= 'catid',to_field='id',blank=False,verbose_name = 'catid')
    title = models.CharField(max_length=150L, blank=True)
    content = models.TextField(blank=True)
    class Meta:
        db_table = 't_about'
        verbose_name = u'about'
        verbose_name_plural = u'about'
        app_label=u"My_Company"

图片说明
图片说明
mysql没有那几个表,一直报错。
syncdb命令也没有用。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问

相似问题

1
django中 django.db.utils.ProgrammingError: (1146, "Table 'xxx' doesn't exist")的问题
2
django admin.py中使用message.error添加提示信息后,会有两个提示信息显示,该怎么办?
1
django创建项目时,urls.py报错:No module named 'index.urls'
2
CentOS7.2+Django1.8+Nginx+uwsgi部署
2
Django搭建的网站登录Xadmin时报错:TemplateDoesNotExist: xadmin/views/register.html。
3
django2.13+xadmin 后台删除数据报错问题
1
Django2.0.4连接sqlser2012数据库报错
1
已配置django-cors-headers,Django跨域访问json还是不成功
4
django刚入门,创建博客的时候出现这个错误,求解决
1
Django 2.2 在后台管理页面执行保存时提示A server error occurred. Please contact the administrator.
4
windows下Django运行python manage.py runserver时报错LookupError: No installed app with label 'admin'.
1
将django从1.5.2升级到1.11,项目中的djblets的最新包只能支持到django1.6,怎么办?
2
python3.7,django 2.21,for...in...Python int too large to convert to C long
0
django、subprocess多进程 报错django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
1
Django2.0中form表单提交跳转到另一个界面目录重复导致404?
1
怎样使用Django从Mysql数据库中,下载数据库内的文件?
2
Django报错:django.server:"GET /favicon.ico HTTP/1.1" 500 59,该如何解决?
0
Django2.2 配置haystack问题
1
django连接MySQL报错django.db.utils.OperationalError: (2006, <NULL>)?
1
如何在django中使用mysql自带的MySQL Connector Python 8.0 for Python 3.7?