2010-07-25 74 views
8

我運行此:爲什麼我得到「找不到夾具」。當我運行「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. 

回答

10

如果您希望您的夾具來執行syncdb我相信你需要把它們放進<app>/fixtures/目錄,並調用文件initial_data.<ext>

選中此期間還可以安裝:

http://docs.djangoproject.com/en/dev/howto/initial-data/#automatically-loading-initial-data-fixtures

+1

此外,如果燈具爲YAML格式,則必須安裝PyYAML,否則仍會出現「No fixtures found」消息。 https://docs.djangoproject.com/en/dev/topics/serialization/#serialization-formats – monofonik 2012-04-12 12:10:01

+0

您可以通過使用'django.core.serializers'中的'get_public_serializer_formats()'函數來查看可用的內容。 – deterb 2013-12-20 18:00:00