Akash
unread,Jan 14, 2011, 1:48:16 AM1/14/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Following are the environment I am working on:
1. Django 1.2.3
2. Python 2.4
3. wsgi
4. Centos 5.4
From apache, I can run makemessage command, and it works. It creates
the *.po files.
I use the following statement for this.
os.system("django-admin.py makemessages -l hi")
But I am unable to do compilemessages from apache. Following are the
steps which I tried out:
os.system("django-admin.py compilemessages") AND
subprocess.Popen(["django-admin.py", "compilemessages"])
The command works fine from command line though, when run from project
location.
$django-admin.py compilemessages.
but when I do python manage.py shell and then try to run it using
os.system, I get the following error:
........
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
'igp_distribution_manager.settings' (Is it on sys.path? Does it have
syntax errors?): No module named igp_distribution_manager.settings
256
So I am not sure If I should be using os.system for this, or if there
is another way to run it from apache.
I am sure I am doing something wrong out here.
If someone have faced this before and have got some solution, then
please guide me to get through it.
Regards,
Akash