Dilla is a multi-purpose general testing tool for automated database spamming, intented to use with projects built on top of Django, populating data within any number of internal applications.
It will, simply, fill your models with lots of nicely generated random data. Not to mention, that you can easily write your own spammers for certain fields or field types. Oooooh yeah!
NEW! Finally, we're on PyPI! Real men use pip, therefore you can do:
pip install django-dilla
Alternatively, you can download this project in either zip or tar formats.
You can also clone the project with Git by running:
$ git clone git://github.com/aerosol/django-dilla
Manual installation will also require you to perform:
python setup.py install
Edit settings.py to integrate into existing Django project:
INSTALLED_APPS = ( ...
'myapp',
'dilla'
)
DICTIONARY = "/usr/share/dict/words"
DILLA_USE_LOREM_IPSUM = False # set to True ignores dictionary
DILLA_APPS = ['myapp', 'auth']
DILLA_EXCLUDE_MODELS = ['myapp.Comments',]
# my_custom_spamlib.py
from dilla import spam
import string
import random
@spam.global_handler('CharField') # field.get_internal_type()
def get_chars(field):
return random.choice(string.ascii_letters)
@spam.strict_handler('myapp.Article.title')
def get_blog_post_title(field):
return random.choice(string.ascii_letters)
and make sure Dilla will use them (settings.py again):
DILLA_SPAMLIBS = ['myapp.my_custom_spamlib']
./manage.py help run_dilla
$ ./manage.py run_dilla --cycles=100
Dilla is going to spam your database. Do you wish to proceed? (Y/N)Y
Dilla finished!
2 app(s) spammed 900 row(s) affected, 2498 field(s) filled, \
502 field(s) ommited.
$
Existing Django project
Identicon (optional as ImageField spammer component)
Adam Rutkowski (adam at mtod org)
Adam Rutkowski (adam at mtod org)