[Django] #18261: Clarify the term "project root directory"

17 views
Skip to first unread message

Django

unread,
May 3, 2012, 6:40:36 AM5/3/12
to django-...@googlegroups.com
#18261: Clarify the term "project root directory"
-------------------------+-------------------------------------------------
Reporter: | Owner: nobody
schnippi | Status: new
Type: | Version: 1.4
Uncategorized | Keywords: project root, root directory,
Component: | translation, makemessages, compilemessages
Documentation | Has patch: 0
Severity: Normal | UI/UX: 0
Triage Stage: |
Unreviewed |
Easy pickings: 0 |
-------------------------+-------------------------------------------------
The documentation at
{{{
https://docs.djangoproject.com/en/dev/topics/i18n/translation/#message-
files
}}}
states that
{{{
django-admin.py 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.

--
Ticket URL: <https://code.djangoproject.com/ticket/18261>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 3, 2012, 9:39:17 AM5/3/12
to django-...@googlegroups.com
#18261: Clarify the term "project root directory"
-------------------------------------+-------------------------------------
Reporter: schnippi | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 1.4
Severity: Normal | Resolution:
Keywords: project root, root | Triage Stage: Accepted
directory, translation, | Needs documentation: 0
makemessages, compilemessages | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by ramiro):

* needs_better_patch: => 0
* needs_docs: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/18261#comment:1>

Django

unread,
May 3, 2012, 1:35:04 PM5/3/12
to django-...@googlegroups.com
#18261: Clarify the term "project root directory"
-------------------------------------+-------------------------------------
Reporter: schnippi | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 1.4
Severity: Normal | Resolution:
Keywords: project root, root | Triage Stage: Accepted
directory, translation, | Needs documentation: 0
makemessages, compilemessages | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (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 `manage.py`", 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 manage.py), because that will set up
sys.path correctly for all their imports to work. This may not apply to
compilemessages/makemessages though.

--
Ticket URL: <https://code.djangoproject.com/ticket/18261#comment:2>

Django

unread,
Jul 6, 2013, 10:50:14 PM7/6/13
to django-...@googlegroups.com
#18261: Clarify the term "project root directory"
-------------------------------------+-------------------------------------
Reporter: schnippi | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: 1.4
Component: Documentation | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: project root, root | Needs documentation: 0
directory, translation, | Patch needs improvement: 0
makemessages, compilemessages | UI/UX: 0
Has patch: 1 |

Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by susan):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/18261#comment:4>

Django

unread,
Jul 6, 2013, 11:35:02 PM7/6/13
to django-...@googlegroups.com
#18261: Clarify the term "project root directory"
-------------------------------------+-------------------------------------
Reporter: schnippi | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: 1.4
Component: Documentation | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: project root, root | Needs documentation: 0
directory, translation, | Patch needs improvement: 0
makemessages, compilemessages | UI/UX: 0
Has patch: 1 |
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by loic84):

FWIW the new default `settings.py` 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".

--
Ticket URL: <https://code.djangoproject.com/ticket/18261#comment:5>

Django

unread,
Jul 7, 2013, 2:33:00 PM7/7/13
to django-...@googlegroups.com
#18261: Clarify the term "project root directory"
-------------------------------------+-------------------------------------
Reporter: schnippi | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: 1.4
Component: Documentation | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: project root, root | Needs documentation: 0
directory, translation, | Patch needs improvement: 0
makemessages, compilemessages | UI/UX: 0
Has patch: 1 |
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by timo):

Could someone familiar with `makemessages` confirm where it should be run
from? I'd expect "project root" means the directory with `manage.py` 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".

--
Ticket URL: <https://code.djangoproject.com/ticket/18261#comment:6>

Django

unread,
Jul 7, 2013, 3:34:45 PM7/7/13
to django-...@googlegroups.com
#18261: Clarify the term "project root directory"
-------------------------------------+-------------------------------------
Reporter: schnippi | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: 1.4
Component: Documentation | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: project root, root | Needs documentation: 0
directory, translation, | Patch needs improvement: 0
makemessages, compilemessages | UI/UX: 0
Has patch: 1 |
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (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.

--
Ticket URL: <https://code.djangoproject.com/ticket/18261#comment:7>

Django

unread,
Jul 7, 2013, 7:33:25 PM7/7/13
to django-...@googlegroups.com
#18261: Clarify the term "project root directory"
-------------------------------------+-------------------------------------
Reporter: schnippi | Owner: susan
Type: | Status: assigned

Cleanup/optimization | Version: 1.4
Component: Documentation | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: project root, root | Needs documentation: 0
directory, translation, | Patch needs improvement: 0
makemessages, compilemessages | UI/UX: 0
Has patch: 1 |
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by susan):

* status: new => assigned
* owner: nobody => susan


--
Ticket URL: <https://code.djangoproject.com/ticket/18261#comment:8>

Django

unread,
Jul 7, 2013, 8:03:45 PM7/7/13
to django-...@googlegroups.com
#18261: Clarify the term "project root directory"
-------------------------------------+-------------------------------------
Reporter: schnippi | Owner: susan
Type: | Status: assigned
Cleanup/optimization | Version: 1.4
Component: Documentation | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: project root, root | Needs documentation: 0
directory, translation, | Patch needs improvement: 0
makemessages, compilemessages | UI/UX: 0
Has patch: 1 |
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by susan):

See PR: https://github.com/django/django/pull/1340/ Feel free to code
review there.

--
Ticket URL: <https://code.djangoproject.com/ticket/18261#comment:9>

Django

unread,
Jul 9, 2013, 7:12:18 AM7/9/13
to django-...@googlegroups.com
#18261: Clarify the term "project root directory"
-------------------------------------+-------------------------------------
Reporter: schnippi | Owner: susan
Type: | Status: closed
Cleanup/optimization | Version: 1.4
Component: Documentation | Resolution: fixed

Severity: Normal | Triage Stage: Accepted
Keywords: project root, root | Needs documentation: 0
directory, translation, | Patch needs improvement: 0
makemessages, compilemessages | UI/UX: 0
Has patch: 1 |
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"ef3fddf26e8bfe956a52c2aa678db6637caf7adf"]:
{{{
#!CommitTicketReference repository=""
revision="ef3fddf26e8bfe956a52c2aa678db6637caf7adf"
Fixed #18261 -- Clarified 'project root directory'
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/18261#comment:10>

Django

unread,
Jul 9, 2013, 7:17:07 AM7/9/13
to django-...@googlegroups.com
#18261: Clarify the term "project root directory"
-------------------------------------+-------------------------------------
Reporter: schnippi | Owner: susan
Type: | Status: closed
Cleanup/optimization | Version: 1.4
Component: Documentation | Resolution: fixed
Severity: Normal | Triage Stage: Accepted
Keywords: project root, root | Needs documentation: 0
directory, translation, | Patch needs improvement: 0
makemessages, compilemessages | UI/UX: 0
Has patch: 1 |
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"5192dbbf5546eb62e1c24d36d91f270b1a2b5eaf"]:
{{{
#!CommitTicketReference repository=""
revision="5192dbbf5546eb62e1c24d36d91f270b1a2b5eaf"
[1.5.x] Fixed #18261 -- Clarified 'project root directory'

Backport of ef3fddf26e from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/18261#comment:11>

Reply all
Reply to author
Forward
0 new messages