Django 不为已安装的应用程序创建表
在我安装 Lion 之前,我的 django 站点可以正常运行,并且必须重新安装与开发相关的所有内容。从那时起,我删除并重新创建了数据库,但我安装的两个应用程序之一在syncdb中被忽略。这些表不存在于我的数据库中。
这篇文章表明可能存在导入错误。我可以使用manage.py shell导入有问题的应用程序,所以我不认为就是这样。
这两个应用程序都已明确安装(通过调试工具栏验证)。还有其他建议吗?我对 Django 比较陌生,过去几年主要是一名 iOS 开发人员。
My django site was functioning before I installed Lion and had to reinstall everything related to development. Since then, I have deleted and recreated my database, but one of my two installed apps is being ignored in syncdb. Those tables are not present in my database.
This post suggested there might be an import error. I can import the app in question using manage.py shell, so I don't think that's it.
Both apps are definitely installed (verified by debug toolbar). Any other suggestions? I'm relatively new to Django, having been mostly an iOS developer for the past couple of years.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
https://docs.djangoproject.com/en/dev/参考/模型/选项/#app-label
它没有提到的是,它们还必须在模型注册阶段的某个地方导入。
https://docs.djangoproject.com/en/dev/ref/models/options/#app-label
What it doesn't mention is that they also have to be imported somewhere during the model registration phase.