Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/project_name/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
]
14 changes: 14 additions & 0 deletions src/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}: {str(e)}")

@task
def collectstatic(ctx):
Expand Down
Loading