Skip to main content

A Django seeding solution build on top of fixtures

Project description

NWON Django seeding

A bunch of functions that you can use for creating seeds for your current application state and loading them.

This is build on top of Django fixtures. This package helps you handle database content and media files as well.

Settings

The Django Seeding package can be configured using the Django settings. We expect the key NWON_DJANGO_SEEDING that holds a dictionary or a pydantic object of type NWONDjangoSeedingSettings. The dictionary must be parsable by NWONDjangoSeedingSettings. The keys mus be snake case or camel case.

For example like this

def directories_for_environment(environment: str) -> SeedDirectories:
    return SeedDirectories(default_directory="", environment_directory="")


def file_seeds_for_environment(environment: str) -> List[ModelFolderMapping]:
    return []

NWON_DJANGO_SEEDING: NWONDjangoSeedingSettings = {
    disable_signals_before_seeding_model=[],
    custom_seed_map={},
    directories_for_environment=directories_for_environment,
    file_directories_for_environment=file_seeds_for_environment,
    default_app_name="nwon",
}

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

nwon_django_seeding-1.0.3.tar.gz (8.4 kB view hashes)

Uploaded Source

Built Distribution

nwon_django_seeding-1.0.3-py3-none-any.whl (14.2 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