1. Mikhail Korobov
  2. django-fab-deploy
Issue #34 invalid

Fatal error: run() encountered an error (return code 1) while executing 'python manage.py help syncdb'

Anonymous created an issue

Hi Mikhail. I love DFD, fantastic module.

Problem running syncdb though (see trace below). I can import the settings module from the python console, so no errors there, but when Django tries to initialise it can't find the settings. {{{

!python

[programcreator@level42.??????.com.au:22] run: cp /home/programcreator/src/programcreator/config.py{,.bak} [programcreator@level42.??????.com.au:22] put: <file obj> -> /home/programcreator/src/programcreator/config.py [programcreator@level42.??????.com.au:22] run: touch /home/programcreator/envs/programcreator/var/wsgi/programcreator.py [programcreator@level42.??????.com.au:22] run: python manage.py help syncdb [programcreator@level42.??????.com.au:22] out: Traceback (most recent call last): [programcreator@level42.??????.com.au:22] out: File "manage.py", line 14, in <module> [programcreator@level42.??????.com.au:22] out: execute_manager(settings) [programcreator@level42.??????.com.au:22] out: File "/home/programcreator/envs/programcreator/lib/python2.6/site-packages/django/core/management/init.py", line 438, in execute_manager [programcreator@level42.??????.com.au:22] out: utility.execute() [programcreator@level42.??????.com.au:22] out: File "/home/programcreator/envs/programcreator/lib/python2.6/site-packages/django/core/management/init.py", line 365, in execute [programcreator@level42.??????.com.au:22] out: self.fetch_command(args[2]).print_help(self.prog_name, args[2]) [programcreator@level42.??????.com.au:22] out: File "/home/programcreator/envs/programcreator/lib/python2.6/site-packages/django/core/management/init.py", line 261, in fetch_command [programcreator@level42.??????.com.au:22] out: klass = load_command_class(app_name, subcommand) [programcreator@level42.??????.com.au:22] out: File "/home/programcreator/envs/programcreator/lib/python2.6/site-packages/django/core/management/init.py", line 67, in load_command_class [programcreator@level42.??????.com.au:22] out: module = import_module('%s.management.commands.%s' % (app_name, name)) [programcreator@level42.??????.com.au:22] out: File "/home/programcreator/envs/programcreator/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module [programcreator@level42.??????.com.au:22] out: import(name) [programcreator@level42.??????.com.au:22] out: File "/home/programcreator/envs/programcreator/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 7, in <module> [programcreator@level42.??????.com.au:22] out: from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal [programcreator@level42.??????.com.au:22] out: File "/home/programcreator/envs/programcreator/lib/python2.6/site-packages/django/core/management/sql.py", line 6, in <module> [programcreator@level42.??????.com.au:22] out: from django.db import models [programcreator@level42.??????.com.au:22] out: File "/home/programcreator/envs/programcreator/lib/python2.6/site-packages/django/db/init.py", line 14, in <module> [programcreator@level42.??????.com.au:22] out: if not settings.DATABASES: [programcreator@level42.??????.com.au:22] out: File "/home/programcreator/envs/programcreator/lib/python2.6/site-packages/django/utils/functional.py", line 276, in getattr [programcreator@level42.??????.com.au:22] out: self._setup() [programcreator@level42.??????.com.au:22] out: File "/home/programcreator/envs/programcreator/lib/python2.6/site-packages/django/conf/init.py", line 42, in _setup [programcreator@level42.??????.com.au:22] out: self._wrapped = Settings(settings_module) [programcreator@level42.??????.com.au:22] out: File "/home/programcreator/envs/programcreator/lib/python2.6/site-packages/django/conf/init.py", line 89, in init [programcreator@level42.??????.com.au:22] out: raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e)) [programcreator@level42.??????.com.au:22] out: ImportError: Could not import settings 'programcreator.settings' (Is it on sys.path?): No module named settings

Fatal error: run() encountered an error (return code 1) while executing 'python manage.py help syncdb'

}}}

Comments (5)

  1. Anonymous

    PS. The execute_manager(settings) call from manage.py has imported the settings module successfully.

  2. Anonymous

    PPS. Running ./manage.py shell throws the same error, so nothing to do with the wsgi code.

  3. Anonymous

    I think this was due to the project name, user name and the app name being identical. Imports seem not to work in such instances.

    Again, brilliant piece of software.

  4. Mikhail Korobov repo owner

    Yes, I think you're right.

    Django < 1.4 adds 2 entries to sys.path: project folder itself and a parent folder of project folder so this leads to an ambiguity when app inside project has the same name as the project. This is changed/fixed in upcoming django 1.4: only the parent of a project folder is added to sys.path.

    Thanks!

  5. Mikhail Korobov repo owner

    Please excuse me for a long delay, I've missed this bug report (bitbucket newsfeed is limited and there are no email notifications if responsible is not set to me).

  6. Log in to comment