python - A better tool than Fixtures to populate a Django Database? -


i set fixtures in django project populate database. works has serious limit: can't create lots of stuff.

in theory, can put elements want, since need write them 1 one, it's impossible have 20 000 items in db.

i need tool fill primary keys itself, , able generate random typed data fill fixtures (e.g: emails, integers in range, dates in range, phones). nice functionally set functional rules in data generation.

does knows way (library, ...) in django project? took @ https://github.com/joke2k/faker - tool seems good, no integration django.

otherwise, guess write myself using faker (since writing fixture file consists on json generation), don't reinvent wheel :)

thanks.

factory boy: https://factoryboy.readthedocs.org

it's fixtures replacement works unit testing or otherwise making fixture data. can write classes hook models , generate populated model instances , can construct them save database, or not.


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -