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
Post a Comment