Populate Django database

后端 未结 2 1206
旧时难觅i
旧时难觅i 2021-02-05 10:46

I\'m developing a Django application which stores user information like their address, phone number, name, etc.

I\'ve worked with PHP\'s Faker library and the seeder inc

2条回答
  •  难免孤独
    2021-02-05 11:26

    Try the django-autofixture app:
    https://github.com/gregmuellegger/django-autofixture

    This app aims to provide a simple way of loading masses of randomly generated test data into your development database. You can use a management command to load test data through command line.

    It is named autofixture because it is based on django's fixtures. Without autofixture you add test data through the admin to see how the non-static pages on your site look. You export data by using dumpdata to send it to your colleagues or to preserve it before you make a manage.py reset app and so on. As your site grows in complexity the process of adding and re-adding data becomes more and more annoying.

    See this django packages too, maybe can help with fake tests and others problems. https://www.djangopackages.com/grids/g/fixtures/

提交回复
热议问题