Skip to main content

A Django app to generate and seed database models with random data.

Project description

Django Data Seed is a powerful Django application designed to populate your database with test data. Using the Faker library, it allows you to generate random test data for your models with a single command via manage.py.

Features

  • Generate random data for various Django model fields
  • Seed database models with randomly generated data
  • Handle complex relationships between models

Installation

To install django-seed, use pip:

pip install django-data-seed

Add django_data_seed to your INSTALLED_APPS in your Django settings:

INSTALLED_APPS = [
    'django_data_seed',
]

Dependencies

This package requires the following Python packages:

  • Django (>=3.2)
  • Faker (>=8.0.0)

These dependencies will be installed automatically when you install django-data-seed using pip. If you need to install them manually, you can use the following commands:

pip install colorama>=0.4.6
pip install Faker>=26.0.0

Usage

Note : The current version of django-data-seed works with native Django fields only. It does not support Django Postgres-specific fields.

Using with command

With django-data-seed, you can seed your database using a single command. The seeddata command is part of the manage.py script.

  • By default django-data-seed populates each model which are configured in settings.py with 10 instances for each model.
python manage.py seeddata 

To specify the number of instances to create for each model, use the --no-of-objects argument:

python3 manage.py seeddata --no-of-objects 100

To populate data for a specific Django app, use the --django-app argument:

python3 manage.py seeddata --django-app app_name

Supported Versions

Django Versions

  • Django 3.2
  • Django 4.0
  • Django 4.1

Python Versions

  • Python 3.7
  • Python 3.8
  • Python 3.9
  • Python 3.10

Operating Systems

  • Windows
  • macOS
  • Linux

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any changes.

Support

If you encounter any issues or have any questions, please open an issue on the GitHub repository.visit the GITHUB

https://github.com/rohith-baggam/django-data-seed

Author

Rohith Bagga

LinkedIn Profile

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-data-seed-0.2.0.tar.gz (10.6 kB view hashes)

Uploaded Source

Built Distribution

django_data_seed-0.2.0-py3-none-any.whl (11.3 kB view hashes)

Uploaded Python 3

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