How to create default users for django init_data?

How can I load data for the default user list when I syncdb?

+4
source share
1 answer

What am I doing.

  • Create users manually.

  • Make dumpdata for the auth.users table.

  • After running syncdb, do loaddata for the reset users.

This is not completely β€œautomatic,” because - ultimately - fully automatic is a terrible idea. Most syncdb operations include database changes, which also require storing some obsolete data, possibly dropping tables and performing other schema migration steps. Each time it includes something special. Therefore, "full automation" rarely works well.

+2
source

Source: https://habr.com/ru/post/1310215/


All Articles