views:

46

answers:

1

How can I loaddata for default list of users, when I syncdb ?

+1  A: 

What I do.

  1. Create users manually.

  2. Do a dumpdata for the auth.users table.

  3. After doing syncdb, do a loaddata for 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.

S.Lott
Note: when running `syncdb` all fixtures named `initial_data.format` found in apps `fixtures` directory are loaded (where "format" is either json, xml etc.). If your fixtures are named other then initial_data you need to explicity load them using `loaddata` command.
rebus
Thanks I got the solution I was using plain text pwd to dump data and so was not able to login using demo data - but dumpdata showed me sha1 encrypted text ! thanks its working now.
Tumbleweed