Skip to main content

Sample data generator

Project description

codecov version downloads license

Install

pip install django-sample-data-generator

Usage

Settings

INSTALLED_APPS = (
        # ...
        'django_sample_generator',
)

SAMPLE_DATA_GENERATORS = (
        'blog.generators',
)

Example

# blog/generators.py

from django_sample_generator import generator
from .models import Blog

class BlogGenerator(generator.ModelGenerator):
        class Meta:
                model = Blog

generators = [
        BlogGenerator(10), # 10 blogs
]
python manage.py create_sample_data

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-sample-data-generator-1.0.5.tar.gz (102.8 kB view hashes)

Uploaded Source

Built Distribution

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