我在我的django项目上安装了一个新的应用程序(社交)。如何在django中删除模型?
当我进入python manage.py runserver 0.0.0.0:8000
我收到以下错误
Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x971d56c>>
Traceback (most recent call last):
...
django.core.management.base.CommandError: One or more models did not validate:
social.socialall: "client_name": CharFields require a "max_length"
attribute that is a positive integer.
social.socialall: "customer_name": CharFields require a "max_length" attribute that is a positive integer.
social.socialall: "publisher_id": CharFields require a "max_length" attribute that is a positive integer.
social.socialall: "currency": CharFields require a "max_length" attribute that is a positive integer.
我创建了一个社会模式而回,但从来没有使用过它,删除它从代码。
我想知道social.socialall
现在在哪里。我假设django.db.models,但我查询我的SQL数据库,并找不到任何东西。
当我在installed_apps中包含社交时,我只会收到此错误消息。
您的数据库在这一点上并不重要。引发异常是因为代码中的某个位置已定义此模型类。删除它,你会没事的。 –