为什么我得到“找不到夹具”。当我运行“python manage.py syncdb”命令?
问题描述:
我运行此:为什么我得到“找不到夹具”。当我运行“python manage.py syncdb”命令?
C:\mysite>python manage.py syncdb
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site
You just installed Django's auth system, which means you don't have any superuse
rs defined.
Would you like to create one now? (yes/no): yes
Username: balu
E-mail address: [email protected]
Password:
Password (again):
Superuser created successfully.
Installing index for auth.Permission model
Installing index for auth.Group_permissions model
Installing index for auth.User_user_permissions model
Installing index for auth.User_groups model
Installing index for auth.Message model
No fixtures found.
答
如果您希望您的夹具来执行syncdb我相信你需要把它们放进<app>/fixtures/
目录,并调用文件initial_data.<ext>
选中此期间还可以安装:
http://docs.djangoproject.com/en/dev/howto/initial-data/#automatically-loading-initial-data-fixtures
此外,如果灯具为YAML格式,则必须安装PyYAML,否则仍会出现“No fixtures found”消息。 https://docs.djangoproject.com/en/dev/topics/serialization/#serialization-formats – monofonik 2012-04-12 12:10:01
您可以通过使用'django.core.serializers'中的'get_public_serializer_formats()'函数来查看可用的内容。 – deterb 2013-12-20 18:00:00