Code

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#10392 closed (fixed)

django-admin.py makemessages requires valid settings

Reported by: zgoda Owned by: mtredinnick
Component: Core (Management commands) Version: master
Severity: Keywords: makemessages
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Today I tried to run makemessages to check for updated keys in Django framework source but I got exception saying I do not have valid settings. Sure I do not have because it's not a project but Django's own code...

jarek:~/install/django/django$ django-admin.py makemessages -l pl
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/bin/django-admin.py", line 5, in <module>
    management.execute_from_command_line()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/management/__init__.py", line 341, in execute_from_command_line
    utility.execute()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/management/__init__.py", line 295, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/management/base.py", line 195, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/management/base.py", line 222, in execute
    output = self.handle(*args, **options)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/management/commands/makemessages.py", line 228, in handle
    make_messages(locale, domain, verbosity, process_all, extensions)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/core/management/commands/makemessages.py", line 56, in make_messages
    settings.configure(USE_I18N = True)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/conf/__init__.py", line 46, in configure
    if self._target != None:
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/utils/functional.py", line 269, in __getattr__
    self._setup()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/conf/__init__.py", line 36, in _setup
    raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE)
ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.
jarek:~/install/django$ LANG=C svn info
Path: .
URL: http://code.djangoproject.com/svn/django/trunk
Repository Root: http://code.djangoproject.com/svn
Repository UUID: bcc190cf-cafb-0310-a4f2-bffc1f526a37
Revision: 9951
Node Kind: directory
Schedule: normal
Last Changed Author: mtredinnick
Last Changed Rev: 9951
Last Changed Date: 2009-03-02 07:08:02 +0100 (Mon, 02 Mar 2009)

Attachments (0)

Change History (3)

comment:1 Changed 5 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to mtredinnick
  • Patch needs improvement unset
  • Status changed from new to assigned

Whoops. Looks like r9945 broke something. I'll fix it now.

comment:2 Changed 5 years ago by mtredinnick

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

(In [9953]) Fixed #10392 -- Fixed an oversight from the refactoring in r9945.

comment:3 Changed 5 years ago by mtredinnick

(In [9954]) [1.0.X] Fixed #10392 -- Fixed an oversight from the refactoring in r9947.

Backport of r9953 from trunk.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.