Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django - Populating a database for test purposes

I need to populate my database with a bunch of dummy entries (around 200+) so that I can test the admin interface I've made and I was wondering if there was a better way to do it. I spent the better part of my day yesterday trying to fill it in by hand (i.e by wrapping stuff like this my_model(title="asdfasdf", field2="laksdj"...) in a bunch of "for x in range(0,200):" loops) and gave up because it didn't work the way I expected it to. I think this is what I need to use, but don't you need to have (existing) data in the database for this to work?

like image 859
Enrico Tuvera Jr Avatar asked Dec 07 '09 02:12

Enrico Tuvera Jr


1 Answers

Check this app

https://github.com/aerosol/django-dilla/

Let's say you wrote your blog application (oh yeah, your favorite!) in Django. Unit tests went fine, and everything runs extremely fast, even those ORM-generated ultra-long queries. You've added several categorized posts and it's still stable as a rock. You're quite sure the app is efficient and ready to for live deployment. Right? Wrong.

like image 66
Eeyore Avatar answered Sep 23 '22 04:09

Eeyore