问题
How can I loaddata for default list of users, when I syncdb ?
回答1:
What I do.
Create users manually.
Do a
dumpdatafor theauth.userstable.After doing syncdb, do a
loaddatafor the dumped users.
It's not totally "automatic" because -- in the long run -- totally automatic is a terrible idea. Most syncdb operations involve database changes that also require you preserve some legacy data, perhaps dropping tables, and doing other "schema migration" steps. Each time it involves something special. So "total automation" rarely works out well.
来源:https://stackoverflow.com/questions/2864522/how-to-create-default-users-on-django-init-data