Seite 1 von 1

Eclipse/aptana manage.py über Degug configuration

Verfasst: Sonntag 7. Juli 2013, 09:32
von ready
Halo ich möchte die Eclipse manage.py über den RUN Knopf starten.
Debug Configurations

Details

Projekt: hk-systemtechnik
Main Module: ${workspace_loc:/hk-systemtechnik/hk/manage.py}
Programm Arguments: runserver noreload 172.26.1.27:9900
Working Directory Other: ${workspace_loc:/hk-systemtechnik}


Doch leoider bekomme ich eine Fehlermeldung:

Code: Alles auswählen

Traceback (most recent call last):
  File "C:\Workspaces\hk-systemtechnik\hk\manage.py", line 14, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Python27\lib\site-packages\django-1.5.1-py2.7.egg\django\core\management\__init__.py", line 453, in execute_from_command_line
    utility.execute()
  File "C:\Python27\lib\site-packages\django-1.5.1-py2.7.egg\django\core\management\__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python27\lib\site-packages\django-1.5.1-py2.7.egg\django\core\management\__init__.py", line 263, in fetch_command
    app_name = get_commands()[subcommand]
  File "C:\Python27\lib\site-packages\django-1.5.1-py2.7.egg\django\core\management\__init__.py", line 109, in get_commands
    apps = settings.INSTALLED_APPS
  File "C:\Python27\lib\site-packages\django-1.5.1-py2.7.egg\django\conf\__init__.py", line 53, in __getattr__
    self._setup(name)
  File "C:\Python27\lib\site-packages\django-1.5.1-py2.7.egg\django\conf\__init__.py", line 48, in _setup
    self._wrapped = Settings(settings_module)
  File "C:\Python27\lib\site-packages\django-1.5.1-py2.7.egg\django\conf\__init__.py", line 134, in __init__
    raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'hk-systemtechnik.settings' (Is it on sys.path?): No module named hk-systemtechnik.settings
Hier noch die manage.py

Code: Alles auswählen

#!/usr/bin/env python
import os
import sys

sys.path.append(os.path.split(os.path.abspath(os.path.dirname(__file__)))[0]);
sys.path.append('%s/hk' % os.path.split(os.path.abspath(os.path.dirname(__file__)))[0]);
sys.path.append('%s/external' % os.path.split(os.path.abspath(os.path.dirname(__file__)))[0]);

if __name__ == "__main__":
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")

    from django.core.management import execute_from_command_line

    execute_from_command_line(sys.argv)
Kann mir jemand Helfen? Danke

Re: Eclipse/aptana manage.py über Degug configuration

Verfasst: Montag 8. Juli 2013, 10:56
von Leonidas
Lass dir doch mal ``sys.path`` ausgeben, dann kannst du schauen ob dein Projekt dort zu finden ist.

Re: Eclipse/aptana manage.py über Degug configuration

Verfasst: Montag 8. Juli 2013, 16:13
von ready
sys.pth sieht so aus:

['C:\\Workspaces\\hk-systemtechnik\\hk', 'C:\\Workspaces\\hk-systemtechnik', 'C:\\Workspaces\\hk-systemtechnik\\external', 'C:\\Python27\\lib\\site-packages\\setuptools-0.8-py2.7.egg', 'C:\\Python27\\lib\\site-packages\\django-1.5.1-py2.7.egg', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages', 'C:\\Windows\\system32\\python27.zip', 'C:\\Workspaces\\hk-systemtechnik', 'C:\\Workspaces\\hk-systemtechnik/hk', 'C:\\Workspaces\\hk-systemtechnik/external']


Mein Prjekt ist auf jeden fall enthalten

Re: Eclipse/aptana manage.py über Degug configuration

Verfasst: Montag 8. Juli 2013, 21:56
von Leonidas
Nicht wirklich, denn er sucht nach ``hk-systemtechnik.settings``, aber bei dir heißt das ``hk-systemtechnik.hk.settings``, d.h. wenn du diese ``hk``-Ebene rausnimmst könnts klappen.