Opened 8 years ago

Closed 2 years 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 by Daniel Brotsky, 8 years ago

Description: modified (diff)

comment:2 by Tim Graham, 8 years ago

Has patch: set
Triage Stage: UnreviewedAccepted

comment:3 by Tim Graham, 8 years ago

Patch needs improvement: set

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

in reply to:  3 comment:4 by Daniel Brotsky, 8 years ago

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 by Filip Łajszczak, 2 years ago

See also possible follow up #34054

Last edited 2 years ago by Filip Łajszczak (previous) (diff)

comment:7 by Mariusz Felisiak, 2 years ago

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

comment:8 by Mariusz Felisiak <felisiak.mariusz@…>, 2 years ago

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