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 []
def disable_seeding() -> List[Type[Model]]:
return []
NWON_DJANGO_SEEDING: NWONDjangoSeedingSettings = {
disable_signals_before_seeding_model=disable_seeding,
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
Built Distribution
Close
Hashes for nwon_django_seeding-1.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 394164f3c31d6249e4ce79bb6eb0941786caf6279e1b6d1d743578ad7987712d |
|
MD5 | 465a34fad1d0b62cc9dc3ed5314023da |
|
BLAKE2b-256 | 7f61ec4264679068996c802c0b0106b8c5a741ffbc2a99f278a3f3e11597e18e |
Close
Hashes for nwon_django_seeding-1.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fa17e18b6f57d40ac87907ddf574bcc67459c5370e263ef7fa36940e5d31fc8 |
|
MD5 | 5aa3fc1ec677fd2db93e1ad6071f2dac |
|
BLAKE2b-256 | e7dce5c17a97361bdcd42e2e2bbf0e72c3478e9e1cb2f4074c1d77aebaf65ec2 |