Opened 4 years ago

Closed 2 years ago

Last modified 2 years ago

#18261 closed Cleanup/optimization (fixed)

Clarify the term "project root directory"

Reported by: schnippi Owned by: susan
Component: Documentation Version: 1.4
Severity: Normal Keywords: project root, root directory, translation, makemessages, compilemessages
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The documentation at

states that makemessages

should be run from "the root directory of your Django project" or "the root directory of your Django app".

As the Django 1.4 directory structure creates mysite/ and mysite/mysite/, it is unclear, what the project's root directory is. Running django-admin makemessages/compilemessages within mysite/ makes the the Django translation system ignore my translation file. Running the commands in mysite/mysite/ instead does work as expected.

It should be explicitly stated in the tutorial, that mysite/mysite/ is the project's root directory.

Attachments (2)

18261.patch (1.7 KB) - added by susan 2 years ago.
A small doc patch for tutorial01.txt.
18261.2.patch (1.8 KB) - added by timo 2 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 4 years ago by ramiro

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 4 years ago by carljm

I'm not familiar enough with the i18n toolchain to be sure where compilemessages/makemessages should be run, or why it would work in one place but not another, but we should _not_ document that mysite/mysite is the "project root directory". The latter is a confusing term that we should maybe just avoid using; if it should have any meaning, it should mean "the directory with", which would be just mysite/. The inner directory is the "project module", the outer directory could be called the "workspace" or "container" or "project root".

In general, we want people running most command-line stuff in the workspace directory (the one with, because that will set up sys.path correctly for all their imports to work. This may not apply to compilemessages/makemessages though.

comment:3 Changed 3 years ago by aaugustin

  • Type changed from Uncategorized to Cleanup/optimization

Changed 2 years ago by susan

A small doc patch for tutorial01.txt.

comment:4 Changed 2 years ago by susan

  • Has patch set

comment:5 Changed 2 years ago by loic84

FWIW the new default refers to that directory as BASE_DIR.

I wasn't a big fan of the BASE_DIR wording (I prefer PROJECT_ROOT) but now that it's there maybe we should refer to that directory as the "base directory".

Changed 2 years ago by timo

comment:6 Changed 2 years ago by timo

Could someone familiar with makemessages confirm where it should be run from? I'd expect "project root" means the directory with but based on what the reporters says, it seems like that directory didn't work for him. I've edited Susan's patch slightly, but it'll need further edits if the existing "project root" reference in translation.txt actually means "project module".

comment:7 Changed 2 years ago by aaugustin

AFAIK makemessages must be run from a directory that contains a locale/ subdirectory where the translations will be collected. locale/ can be anywhere as long as it's in LOCALE_PATHS.

Django does *not* have a concept of a "project root", no matter how you frame it.

comment:8 Changed 2 years ago by susan

  • Owner changed from nobody to susan
  • Status changed from new to assigned

comment:9 Changed 2 years ago by susan

See PR: Feel free to code review there.

comment:10 Changed 2 years ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

In ef3fddf26e8bfe956a52c2aa678db6637caf7adf:

Fixed #18261 -- Clarified 'project root directory'

comment:11 Changed 2 years ago by Tim Graham <timograham@…>

In 5192dbbf5546eb62e1c24d36d91f270b1a2b5eaf:

[1.5.x] Fixed #18261 -- Clarified 'project root directory'

Backport of ef3fddf26e from master

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