Created
June 1, 2017 07:46
-
-
Save Everfighting/c5ebc366de552fd36479ffdaa447c73c to your computer and use it in GitHub Desktop.
faker快速制造django假数据
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from faker import Factory | |
| fake = Factory.create() | |
| for i in range(100): | |
| c = CusQuestions( | |
| que_no = fake.text(max_nb_chars=90), | |
| loan_no = fake.text(max_nb_chars=90), | |
| ) | |
| c.save() | |
| # 安装pip install faker | |
| # 以上代码放入models中 | |
| # 写入对应类和对应字段,指定数据类型 | |
| # 运行python manage.py runserver |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment