1

I'm writing this post because after hours of research around, no real solution was found about my issue.

I've a Django project that used to run on another computer. Now, I've a new one, I've reinstalled Django and VirtualEnvWrapper.

I've cloned my project from my git and I can work and deploy without any issues.

Running ./manage.py works when I'm on the correct virtualenv (via workon 'my_project_name').

My problem is that I can't generate translations any more.

Here is the trace-back:

(MyProject)--- python/MyProject ‹master*➔ M› »django-admin.py makemessages --all
Traceback (most recent call last):
File "/usr/local/bin/django-admin.py", line 5, in <module>
    management.execute_from_command_line()
  File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 376, in execute
    sys.stdout.write(self.main_help_text() + '\n')
  File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 240, in main_help_text
    for name, app in six.iteritems(get_commands()):
  File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 107, in get_commands
    apps = settings.INSTALLED_APPS
  File "/Library/Python/2.7/site-packages/django/conf/__init__.py", line 54, in __getattr__
    self._setup(name)
  File "/Library/Python/2.7/site-packages/django/conf/__init__.py", line 49, in _setup
    self._wrapped = Settings(settings_module)
  File "/Library/Python/2.7/site-packages/django/conf/__init__.py", line 132, in __init__
    % (self.SETTINGS_MODULE, e)
ImportError: Could not import settings 'MyProject.settings.local' (Is it on sys.path? Is there an import error in the settings file?): No module named MyProject.settings.local

When I'm checking my sys.path, here is the content:

/Users/jbcollet/.virtualenvs/MyProject/lib/python27.zip
/Users/jbcollet/.virtualenvs/MyProject/lib/python2.7
/Users/jbcollet/.virtualenvs/MyProject/lib/python2.7/plat-darwin
/Users/jbcollet/.virtualenvs/MyProject/lib/python2.7/plat-mac
/Users/jbcollet/.virtualenvs/MyProject/lib/python2.7/plat-mac/lib-scriptpackages
/Users/jbcollet/.virtualenvs/MyProject/Extras/lib/python
/Users/jbcollet/.virtualenvs/MyProject/lib/python2.7/lib-tk
/Users/jbcollet/.virtualenvs/MyProject/lib/python2.7/lib-old
/Users/jbcollet/.virtualenvs/MyProject/lib/python2.7/lib-dynload
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
/Users/jbcollet/.virtualenvs/MyProject/lib/python2.7/site-packages

Can someone help me with this?

Thanks a lot

Bhavesh Odedra
  • 10,990
  • 12
  • 33
  • 58
colletjb
  • 279
  • 3
  • 16
  • You probably haven't added any `LOCALE_PATHS` in settings.py – ruddra Jul 09 '14 at 08:30
  • Thanks for the help. All my apps have a directory "locale" which contains an "en" directory with "LC_MESSAGES" inside. What should i put in this settings then? – colletjb Jul 09 '14 at 08:35
  • @AndrewS I checked: (MyProject)--- python/MyProject ‹master*➔ M› » which django-admin.py 1 ↵ /usr/local/bin/django-admin.py – colletjb Jul 09 '14 at 08:37
  • Sorry - deleted my comment. Not sure if it would make a difference actually. When I run the admin command it runs from within the virtual env. – AndrewS Jul 09 '14 at 08:38
  • 1
    This post might be of use; http://stackoverflow.com/questions/13775780/django-1-5b1-executing-django-admin-py-causes-no-module-named-settings-error?rq=1. Running the version in the virtual env may resolve the issue. – AndrewS Jul 09 '14 at 08:45
  • Does `manage.py makemessages --all` when in the virtual env work? – AndrewS Jul 09 '14 at 08:48
  • Thanks @AndrewS, my error was from my $PYTHONPATH. I will set it on my postactivate script ;) – colletjb Jul 09 '14 at 09:19

0 Answers0