From the docs(https://docs.djangoproject.com/en/1.9/ref/django-admin/):
''The command-line examples throughout this document use django-admin to
be consistent, but any example can use manage.py or python -m django just
as well.''
However, this doesn't seem to be true for ''makemessages''.
If I run ''manage.py makemessages'' from the top level of the project
MEDIA_ROOT and STATIC_ROOT are ignored. This isn't precisely a bug because
that's what the code is intended to do
(https://github.com/django/django/blob/master/django/core/management/commands/makemessages.py#L448),
but I find it strange specially for ''--domain djangojs'' because is very
common for Javascript files to be put in STATIC_ROOT.
django-admin makemessages doesn't ignore MEDIA_ROOT or STATIC_ROOT and it
traverses the entire source tree.
At least this should be explained in the documentation. At best both
commands should do the exact same. It's very easy to be bitten by this as
we don't always review the resulting *.po file.
Am I missing something here?
--
Ticket URL: <https://code.djangoproject.com/ticket/26940>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Maybe the documentation should mention that `--settings` must be specified
to `django-admin` and `python -m django` for them to be interchangeable
with `manage.py`.
--
Ticket URL: <https://code.djangoproject.com/ticket/26940#comment:1>
* type: Uncategorized => Bug
* stage: Unreviewed => Accepted
Comment:
Currently, `makemessages` is explicitly whitelisted as not needing a
configured settings file (see `no_settings_commands` in
`django.core.management.__init__.py`.
I wonder now if we should revert that, considering the dependency of that
command on `settings.FILE_CHARSET`, `settings.LOCALE_PATHS`,
`settings.MEDIA_ROOT`, and `settings.STATIC_ROOT`.
--
Ticket URL: <https://code.djangoproject.com/ticket/26940#comment:2>
* has_patch: 0 => 1
* version: 1.9 => master
Comment:
[https://github.com/django/django/pull/7040 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/26940#comment:3>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/26940#comment:4>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"a6baada7bdf0c2b14045ee86364f9401c7b91b7c" a6baada7]:
{{{
#!CommitTicketReference repository=""
revision="a6baada7bdf0c2b14045ee86364f9401c7b91b7c"
Fixed #26940 -- Removed makemessages from no_settings_commands whitelist
As makemessages uses several settings for proper run (FILE_CHARSET,
LOCALE_PATHS, MEDIA_ROOT, and STATIC_ROOT), we should require settings
configuration for this command.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26940#comment:5>
* status: closed => new
* resolution: fixed =>
* stage: Ready for checkin => Unreviewed
Comment:
I'm considering reverting the fact that we require configured settings for
makemessages.
I'm thinking about the use case of reusable apps, when you typically don't
have/need STATIC_ROOT/MEDIA_ROOT/LOCALE_PATHS, and most of the time
FILE_CHARSET in utf-8 is fine.
See
[https://github.com/django/django/commit/c0ad0ede253e7fb590acf1eec58f04380f742e3a
this commit], above [https://github.com/django/django/pull/7315 that PR].
--
Ticket URL: <https://code.djangoproject.com/ticket/26940#comment:6>
Comment (by Claude Paroz):
Here's the [https://github.com/django/django/pull/7328 PR].
--
Ticket URL: <https://code.djangoproject.com/ticket/26940#comment:7>
* stage: Unreviewed => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/26940#comment:8>
Comment (by Claude Paroz <claude@…>):
In [changeset:"fa2f55cfd554c6f99653ffe0d40fd7ca74cb680e" fa2f55c]:
{{{
#!CommitTicketReference repository=""
revision="fa2f55cfd554c6f99653ffe0d40fd7ca74cb680e"
Refs #26940 -- Re-allowed makemessages without settings
Thanks Tim Graham for the review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26940#comment:9>
* status: new => closed
* resolution: => fixed
--
Ticket URL: <https://code.djangoproject.com/ticket/26940#comment:10>