2011-01-15 12 views
1

Ich habe alles auf der folgenden Seite gesagt getan.django auf ubuntu

https://help.ubuntu.com/community/Django 

aber es gibt mir eine Fehlerseite.

MOD_PYTHON ERROR

ProcessId: 2220 Interpreter:
'localhost.localdomain'

ServerName:
'localhost.localdomain' DocumentRoot: '/etc/apache2/htdocs'

URI: '/' Location:
'/' Directory: None Filename:
'/etc/apache2/htdocs' PathInfo:
'/'

Phase: 'PythonHandler' Handler:
'django.core.handlers.modpython'

Traceback (most recent call last):

File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1537, in HandlerDispatch default=default_handler, arg=req, silent=hlist.silent)

File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1229, in _process_target result = _execute_target(config, req, object, arg)

File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1128, in _execute_target result = object(arg)

File "/usr/lib/pymodules/python2.6/django/core/handlers/modpython.py", line 228, in handler return ModPythonHandler()(req)

File "/usr/lib/pymodules/python2.6/django/core/handlers/modpython.py", line 191, in call self.load_middleware()

File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py", line 33, in load_middleware for middleware_path in settings.MIDDLEWARE_CLASSES:

File "/usr/lib/pymodules/python2.6/django/utils/functional.py", line 276, in getattr self._setup()

File "/usr/lib/pymodules/python2.6/django/conf/init.py", line 40, in _setup self._wrapped = Settings(settings_module)

File "/usr/lib/pymodules/python2.6/django/conf/init.py", line 75, 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 'examples.settings' (Is it on sys.path? Does it have syntax errors?): No module named examples.settings

was könnte falsch sein?

komplette noob hier.

+2

mod_python ist tot. Ziehen Sie in Betracht, so bald wie möglich zu mod_wsgi zu wechseln. –

+0

das ist Phase II. Am Anfang wäre es einfacher für mich, wenn mir jemand sagen könnte, was ich damit falsch mache. :) – debuggerpk

Antwort

3

Wenn Sie Django-Projekt für die Produktion unter Ubuntu-Server bereitstellen, wird empfohlen, WSGI zu verwenden. Nur brach der django Dokumentation: https://docs.djangoproject.com/en/1.3/howto/deployment/modwsgi/

Installation von Apache mit wsgi unter ubuntu ist einfach:

apt-get install libapache2-mod-wsgi 

Falls Sie nur django erkunden wollen Sie nicht auf Setup Apache oder etwas brauchen. Verwenden Sie stattdessen manage.py runserver.

+0

danke :) .. es hat geholfen – debuggerpk