Opened 7 years ago

Closed 12 months ago

#26975 closed Bug (fixed)

Unclear documentation: use of paths with loaddata

Reported by: Daniel Brotsky Owned by: Filip Łajszczak
Component: Documentation Version: 1.9
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Daniel Brotsky)

The howto on fixtures [1] states that providing a path to loaddata overrides the usual search, but in fact this is only true of an absolute path. Relative paths to fixture files can be used to namespace them as with templates and static files.

I suggest that the docs be updated to clarify this point about paths and to add namespacing advice for fixture files analogous to that for templates [2] and static files [3]. I have prepared a pull request [4] with a suggested fix.

References:
[1] https://docs.djangoproject.com/en/1.9/howto/initial-data/#where-django-finds-fixture-files
[2] https://docs.djangoproject.com/en/1.9/intro/tutorial03/
[3] https://docs.djangoproject.com/en/1.9/howto/static-files/#configuring-static-files
[4] https://github.com/django/django/pull/6996

Change History (8)

comment:1 Changed 7 years ago by Daniel Brotsky

Description: modified (diff)

comment:2 Changed 7 years ago by Tim Graham

Has patch: set
Triage Stage: UnreviewedAccepted

comment:3 Changed 7 years ago by Tim Graham

Patch needs improvement: set

Left an idea for improvement on the PR. Please uncheck "Patch needs improvement" when you update it.

comment:4 in reply to:  3 Changed 7 years ago by Daniel Brotsky

I am happy to improve the patch, but have in mind a slightly different approach, and would like your opinion. Please see the PR for details.

comment:6 Changed 12 months ago by Filip Łajszczak

See also possible follow up #34054

Last edited 12 months ago by Filip Łajszczak (previous) (diff)

comment:7 Changed 12 months ago by Mariusz Felisiak

Owner: changed from nobody to Filip Łajszczak
Patch needs improvement: unset
Status: newassigned
Triage Stage: AcceptedReady for checkin

comment:8 Changed 12 months ago by Mariusz Felisiak <felisiak.mariusz@…>

Resolution: fixed
Status: assignedclosed

In fe6f4be:

Fixed #26975 -- Clarified how Django looks for fixture files.

Co-Authored-By: Daniel Brotsky <dev@…>

Note: See TracTickets for help on using tickets.
Back to Top