Skip to main content

General-purpose testing tool that populates your Django models with random data.

Project description

What's Dilla?
======
General-purpose testing tool
* Django custom management command
* Random data generator
* i.e. models.SlugField() will get corporis_maxime_architecto_689 value, not hwegid24#!@#1ty51794t
* images (see Screenshots)


Why would I need that?
========================
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.

Dilla would add hundreds of categories, posts and even photos to your app in seconds. After it's done you migh re-consider your deployment plans.

HowTos
=======

* Add Dilla to INSTALLED_APPS tuple

INSTALLED_APPS = ( ...
'dilla',
)

* Check if it works
$ ./manage.py help dilla
Usage: manage.py dilla [options] appname [appname ...]

...
* Make sure you're running development environment. You don't want to have your production db filled with junk, do you?
* Review your models. Maybe there are some, that you wouldn't like to be populated by Dilla?

class BlogConfiguration(models.Model):
...
class Dilla:
skip_model = True
# or you might want to skip specified fields
# skip_fields = ('hash', 'user',)

* Want Dilla to generate images for you? Just let it know.

class BlogPostImage:
# example: sorl-thumbnail field
image = ImageWithThumbnailsField("Blog post image", upload_to='images/%Y/%m/%d',
thumbnail={'size': THUMB_SET[0] }, height_field = 'height', width_field = 'width',
extra_thumbnails=THUMB_SET[1]
)

...

class Dilla:
image_fields = ('image', )
generate_images = True
image_resolution = '640x480'

* Run 200 iterations on your app model
$ ./manage.py dilla blog -i 200
You're done. Expect funny data. Profile your queries etc.

Project details


Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page