diff --git a/src/project_name/settings.py b/src/project_name/settings.py index 6603fd8d..d6b89cb6 100644 --- a/src/project_name/settings.py +++ b/src/project_name/settings.py @@ -76,3 +76,7 @@ TEMPLATES[0]["OPTIONS"]["loaders"] = loaders TEMPLATES[0].pop("APP_DIRS", None) + +PROJECT_FIXTURES = [ + # List project-related fixture files here, in the order they should be loaded. +] \ No newline at end of file diff --git a/src/tasks.py b/src/tasks.py index 549c3bb6..44088b5d 100644 --- a/src/tasks.py +++ b/src/tasks.py @@ -402,6 +402,20 @@ def fixtures(ctx): pty=True, ) + # Load Project related fixtures + from django.conf import settings + project_fixtures = getattr(settings, 'PROJECT_FIXTURES', []) + + for fixture in project_fixtures: + if fixture: + print(f"Loading project fixture: {fixture}") + try: + ctx.run( + f"python manage.py loaddata {fixture} --settings={_localsettings()}", + pty=True + ) + except Exception as e: + print(f"Warning: Failed to load fixture {fixture}: {e}") @task def collectstatic(ctx):