Hi,

I am new to Django.  The tutorial all went fine, but I'm having no success in 
getting
Apache to yield anything useful.  I have probably done something truly stupid 
-- and
hopefully obvious -- and would appreciate someone pointing out my error(s).

System: Debian/Linux (Etch/testing: Apache-2, mod_python 3).  Django 0.91, 
python 2.3

In /var/www, I put a symlink to the "myproject" directory so that Apache could
find django, named "proj".

In the apache config file:
        <Location "/proj/">
                SetHandler mod_python
                PythonHandler django.core.handlers.modpython
                PythonPath sys.path+"['/home/Projects/django']"
                SetEnv DJANGO_SETTINGS_MODULE 
.home.Projects.django.myproject.settings
                PythonDebug On
        </Location>

When I point the browser to 127.0.0.1/8080, I can see both the initial default
apache target and "proj".  Clicking then reloading "proj" cycles through 
several different
error messages:

--- First: ---------------------------

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

   File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in 
HandlerDispatch
     result = object(req)

   File 
"/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/core/handlers/modpython.py",
 line 165, in handler
     return ModPythonHandler()(req)

   File 
"/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/core/handlers/modpython.py",
 line 130, in __call__
     from django.conf import settings

   File 
"/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/conf/settings.py",
 line 32, in ?
     mod = __import__(me.SETTINGS_MODULE, '', '', [''])

ValueError: Empty module name

--- 2. Attempting to reload the page: -------

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

   File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 276, in 
HandlerDispatch
     newpath = eval(pathstring)

   File "", line 0, in ?

TypeError: can only concatenate list (not "str") to list

--- 3. Attempting to reload the page again: -------

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

   File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in 
HandlerDispatch
     result = object(req)

   File 
"/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/core/handlers/modpython.py",
 line 165, in handler
     return ModPythonHandler()(req)

   File 
"/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/core/handlers/modpython.py",
 line 135, in __call__
     self.load_middleware()

   File 
"/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/core/handlers/base.py",
 line 26, in load_middleware
     mod = __import__(mw_module, '', '', [''])

   File 
"/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/middleware/sessions.py",
 line 2, in ?
     from django.models.core import sessions

   File 
"/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/models/__init__.py",
 line 13, in ?
     modules = meta.get_installed_model_modules(__all__)

   File 
"/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/core/meta/__init__.py",
 line 108, in get_installed_model_modules
     _installed_modules_cache.append(__import__('django.models.%s' % submodule, 
'', '', ['']))

   File 
"/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/models/auth.py", 
line 2, in ?
     from django.models import core

   File 
"/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/models/core.py", 
line 6, in ?
     class Site(meta.Model):

   File 
"/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/models/core.py", 
line 7, in Site
     domain = meta.CharField(_('domain name'), maxlength=100)

   File 
"/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/core/meta/fields.py",
 line 112, in __init__
     self.verbose_name = verbose_name or (name and name.replace('_', ' '))

   File 
"/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/utils/functional.py",
 line 42, in __wrapper__
     res = self.__func(*self.__args, **self.__kw)

   File 
"/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/utils/translation.py",
 line 243, in gettext
     _default = translation(settings.LANGUAGE_CODE)

   File 
"/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/utils/translation.py",
 line 121, in translation
     project = __import__(parts[0], {}, {}, [])

ValueError: Empty module name

--- 4. Attempting to reload the page again: -------

This time it repeats the message shown in (1), above

--- 5.  On the fifth attempt, and in subsequent attempts: ---------

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

   File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in 
HandlerDispatch
     result = object(req)

   File 
"/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/core/handlers/modpython.py",
 line 165, in handler
     return ModPythonHandler()(req)

   File 
"/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/core/handlers/modpython.py",
 line 135, in __call__
     self.load_middleware()

   File 
"/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/core/handlers/base.py",
 line 32, in load_middleware
     raise exceptions.ImproperlyConfigured, 'Middleware module "%s" does not 
define a "%s" class' % (mw_module, mw_classname)

ImproperlyConfigured: Middleware module "django.middleware.sessions" does not 
define a "SessionMiddleware" class

----------------------------------------------------
The "SessionMiddleware" fix reported in the django web site doesn't seem to 
apply,
as the conf value is already first.

Any clues?  This hardware guy thanks you in advance!

        -frank

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to