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.1.tar.gz (102.5 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file django-sample-data-generator-1.0.1.tar.gz.

File metadata

File hashes

Hashes for django-sample-data-generator-1.0.1.tar.gz
Algorithm Hash digest
SHA256 5e4f337b3739a730442240ca51255b34995bc7b66797377703c66bb76467ea28
MD5 0c8ba0e54be24ec13faf243ef1ac7dac
BLAKE2b-256 116d28938ddbc85d7deb14801d522b8f46e71a689bb72d6549b1fbf72d118182

See more details on using hashes here.

Provenance

File details

Details for the file django_sample_data_generator-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_sample_data_generator-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 906a8a67d6ceb354f76506f2f245bdc2aa04f9bba4c14e445adf1e64cd8c050d
MD5 a896932269f2eb812698ddd92cbfaae7
BLAKE2b-256 d6d3fa8e10cca3cae03517bf3760b6cf6db02b4975e344482377c16ee7df491c

See more details on using hashes here.

Provenance

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