Users in initial data fixture

后端 未结 6 1671
臣服心动
臣服心动 2021-01-31 01:50

I\'m creating a few users by default in my fixtures/initial_data.json so as to have some testing \"subjects.\" The problem I\'m experiencing is password generation.

6条回答
  •  生来不讨喜
    2021-01-31 02:13

    Dump Users information from DataBase:

    $ python manage.py dumpdata auth.User --indent 4 > users.json
    

    Import / load data especific JSON fixture:

    $ python manage.py loaddata users.json
    

提交回复
热议问题