#15073: django i18n issue
-----------------------------+----------------------------------------------
 Reporter:  rameshsahoo      |       Owner:  nobody    
   Status:  new              |   Milestone:            
Component:  Django Web site  |     Version:  1.2       
 Keywords:                   |       Stage:  Unreviewed
Has_patch:  0                |  
-----------------------------+----------------------------------------------
 I am trying to generate an .mo file from a .po file using django-admin.py
 compilemessages. I am having Django 1.2.3 on Centos 5.4 with mod_wsgi. The
 issue is when I try to run the command which is os.system("django-admin.py
 compilemessages") from my project directory which is "/var/opt/project-
 name", it throws an error.

 Traceback (most recent call last):
   File "/usr/lib/python2.4/site-packages/django/bin/django-admin.py", line
 5, in ?
     management.execute_from_command_line()
   File "/usr/lib/python2.4/site-
 packages/django/core/management/__init__.py", line 429, in
 execute_from_command_line
     utility.execute()
   File "/usr/lib/python2.4/site-
 packages/django/core/management/__init__.py", line 379, in execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/usr/lib/python2.4/site-packages/django/core/management/base.py",
 line 191, in run_from_argv
     self.execute(*args, **options.__dict__)
   File "/usr/lib/python2.4/site-packages/django/core/management/base.py",
 line 220, in execute
     output = self.handle(*args, **options)
   File "/usr/lib/python2.4/site-
 packages/django/core/management/commands/compilemessages.py", line 52, in
 handle
     compile_messages(locale)
   File "/usr/lib/python2.4/site-
 packages/django/core/management/commands/compilemessages.py", line 10, in
 compile_messages
     basedirs.extend(settings.LOCALE_PATHS)
   File "/usr/lib/python2.4/site-packages/django/utils/functional.py", line
 276, in __getattr__
     self._setup()
   File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line
 40, in _setup
     self._wrapped = Settings(settings_module)
   File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line
 74, in __init__
     raise ImportError("Could not import settings '%s' (Is it on sys.path?
 Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e))
 ImportError: Could not import settings 'project.settings' (Is it on
 sys.path? Does it have syntax errors?): No module named project.settings
 256

 The exact steps that I followed is as follows:
 (This is from the project directory)
 $ python manage.py shell
 >>> import os
 >>> os.system("django-admin.py compilemessages")

 The minute I do enter, it throws this error. I have appended my project
 path in sys.path still its not working.
 My mod_wsgi configuration is:

 import os, sys
 sys.path.append('/var/opt')
 #sys.path.insert(0, '/var/opt')
 sys.path.insert(0, '/var/opt/project')
 os.environ['DJANGO_SETTINGS_MODULE'] = 'project.settings'
 import django.core.handlers.wsgi
 application = django.core.handlers.wsgi.WSGIHandler()

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to