0

I have installed pinax, and created a project with the pinax-admin

then I copied the project into an empty django-eclipse project and wanted to run synchdb form the eclipse console but I only get:

Traceback (most recent call last):
  File "C:\Users\marcus\Desktop\wseclipse\testpinax\testsite\manage.py", line 20, in <module>
    execute_from_command_line()
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 261, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 69, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 35, in import_module
    __import__(name)
  File "C:\Python27\lib\site-packages\django\core\management\commands\syncdb.py", line 8, in <module>
    from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal
  File "C:\Python27\lib\site-packages\django\core\management\sql.py", line 6, in <module>
    from django.db import models
  File "C:\Python27\lib\site-packages\django\db\__init__.py", line 11, in <module>
    if DEFAULT_DB_ALIAS not in settings.DATABASES:
  File "C:\Python27\lib\site-packages\django\utils\functional.py", line 184, in inner
    self._setup()
  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 95, in __init__
    raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'testpinax.settings' (Is it on sys.path?): No module named testpinax.settings
Finished "manage.py syncdb" execution.

I have the tables created in my postgresql db, but when I want to run the project I get:

Traceback (most recent call last):
  File "C:\Users\marcus\Desktop\wseclipse\testpinax\testsite\manage.py", line 20, in <module>
    execute_from_command_line()
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 261, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 69, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 35, in import_module
    __import__(name)
  File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line 8, in <module>
    from django.core.servers.basehttp import AdminMediaHandler, run, WSGIServerException, get_internal_wsgi_application
  File "C:\Python27\lib\site-packages\django\core\servers\basehttp.py", line 26, in <module>
    from django.views import static
  File "C:\Python27\lib\site-packages\django\views\static.py", line 95, in <module>
    template_translatable = ugettext_noop(u"Index of %(directory)s")
  File "C:\Python27\lib\site-packages\django\utils\translation\__init__.py", line 75, in gettext_noop
    return _trans.gettext_noop(message)
  File "C:\Python27\lib\site-packages\django\utils\translation\__init__.py", line 48, in __getattr__
    if settings.USE_I18N:
  File "C:\Python27\lib\site-packages\django\utils\functional.py", line 184, in inner
    self._setup()
  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 95, in __init__
    raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
**ImportError: Could not import settings 'testpinax.settings' (Is it on sys.path?): No module named testpinax.settings**

BUT when I look at my project you can see that the settings.py file is there:

enter image description here

What am I doing wrong?

PS.: I am running win7, eclipse indigo and postgresl 1.16

UPDATE

>>> import sys
>>> print sys.path
['', 'C:\\Python27\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg', 'C:\\Pytho
n27\\lib\\site-packages\\pip-1.2.1-py2.7.egg', 'C:\\Windows\\system32\\python27.
zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win',
'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages']
maximus
  • 11,264
  • 30
  • 93
  • 124

1 Answers1

0

The Error Message asks you to append the testpinax folder to your PYTHONPATH environment variable, view this wiki entry for a possible solution on how to achieve that.

The Problem might originate from you not starting the script from the testpinax folder.

Community
  • 1
  • 1
tehmisvh
  • 584
  • 3
  • 9