I'm getting an ImportError... I think it's a sys.path problem but I
can't figure out what to do. Below are the details. Any help?
## Mod Python Error ##
MOD_PYTHON ERROR
ProcessId: 17855
Interpreter: 'my_django'
ServerName: 'cube.twusa.ca'
DocumentRoot: '/var/www/html'
URI: '/'
Location: '/'
Directory: None
Filename: '/var/www/html/'
PathInfo: ''
Phase: 'PythonHandler'
Handler: 'django.core.handlers.modpython'
Traceback (most recent call last):
File "/opt/python2.6/lib/python2.6/site-packages/mod_python/
importer.py", line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)
File "/opt/python2.6/lib/python2.6/site-packages/mod_python/
importer.py", line 1229, in _process_target
result = _execute_target(config, req, object, arg)
File "/opt/python2.6/lib/python2.6/site-packages/mod_python/
importer.py", line 1128, in _execute_target
result = object(arg)
File "/opt/python2.6/lib/python2.4/site-packages/django/core/
handlers/modpython.py", line 228, in handler
return ModPythonHandler()(req)
File "/opt/python2.6/lib/python2.4/site-packages/django/core/
handlers/modpython.py", line 201, in __call__
response = self.get_response(request)
File "/opt/python2.6/lib/python2.4/site-packages/django/core/
handlers/base.py", line 134, in get_response
return self.handle_uncaught_exception(request, resolver, exc_info)
File "/opt/python2.6/lib/python2.4/site-packages/django/core/
handlers/base.py", line 154, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/opt/python2.6/lib/python2.4/site-packages/django/views/
debug.py", line 40, in technical_500_response
html = reporter.get_traceback_html()
File "/opt/python2.6/lib/python2.4/site-packages/django/views/
debug.py", line 114, in get_traceback_html
return t.render(c)
File "/opt/python2.6/lib/python2.4/site-packages/django/template/
__init__.py", line 178, in render
return self.nodelist.render(context)
File "/opt/python2.6/lib/python2.4/site-packages/django/template/
__init__.py", line 779, in render
bits.append(self.render_node(node, context))
File "/opt/python2.6/lib/python2.4/site-packages/django/template/
debug.py", line 81, in render_node
raise wrapped
TemplateSyntaxError: Caught an exception while rendering: No module
named cube.books
Original Traceback (most recent call last):
File "/opt/python2.6/lib/python2.4/site-packages/django/template/
debug.py", line 71, in render_node
result = node.render(context)
File "/opt/python2.6/lib/python2.4/site-packages/django/template/
debug.py", line 87, in render
output = force_unicode(self.filter_expression.resolve(context))
File "/opt/python2.6/lib/python2.4/site-packages/django/template/
__init__.py", line 572, in resolve
new_obj = func(obj, *arg_vals)
File "/opt/python2.6/lib/python2.4/site-packages/django/template/
defaultfilters.py", line 687, in date
return format(value, arg)
File "/opt/python2.6/lib/python2.4/site-packages/django/utils/
dateformat.py", line 269, in format
return df.format(format_string)
File "/opt/python2.6/lib/python2.4/site-packages/django/utils/
dateformat.py", line 30, in format
pieces.append(force_unicode(getattr(self, piece)()))
File "/opt/python2.6/lib/python2.4/site-packages/django/utils/
dateformat.py", line 175, in r
return self.format('D, j M Y H:i:s O')
File "/opt/python2.6/lib/python2.4/site-packages/django/utils/
dateformat.py", line 30, in format
pieces.append(force_unicode(getattr(self, piece)()))
File "/opt/python2.6/lib/python2.4/site-packages/django/utils/
encoding.py", line 71, in force_unicode
s = unicode(s)
File "/opt/python2.6/lib/python2.4/site-packages/django/utils/
functional.py", line 201, in __unicode_cast
return self.__func(*self.__args, **self.__kw)
File "/opt/python2.6/lib/python2.4/site-packages/django/utils/
translation/__init__.py", line 62, in ugettext
return real_ugettext(message)
File "/opt/python2.6/lib/python2.4/site-packages/django/utils/
translation/__init__.py", line 43, in delayed_loader
return g['real_%s' % caller](*args, **kwargs)
File "/opt/python2.6/lib/python2.4/site-packages/django/utils/
translation/trans_real.py", line 286, in ugettext
return do_translate(message, 'ugettext')
File "/opt/python2.6/lib/python2.4/site-packages/django/utils/
translation/trans_real.py", line 276, in do_translate
_default = translation(settings.LANGUAGE_CODE)
File "/opt/python2.6/lib/python2.4/site-packages/django/utils/
translation/trans_real.py", line 194, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File "/opt/python2.6/lib/python2.4/site-packages/django/utils/
translation/trans_real.py", line 180, in _fetch
app = import_module(appname)
File "/opt/python2.6/lib/python2.4/site-packages/django/utils/
importlib.py", line 35, in import_module
__import__(name)
ImportError: No module named cube.books
## Apache Settings ##
<VirtualHost *:80>
ServerAdmin
[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>
ServerAlias cube.twusa.ca<http://cube.twusa.ca><http://cube.twusa.ca>
ServerName cube.twusa.ca<http://cube.twusa.ca><http://cube.twusa.ca>
ErrorLog logs/cube_twusa_ca.error_log
CustomLog logs/cube_twusa_ca.access_log common
Alias /phpMyAdmin "/var/www/phpMyAdmin/"
<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE settings
PythonOption django.root ''
PythonDebug On
PythonPath "['/data/hosting/cube/cube' , '/opt/python2.6/lib/
python2.4/site-packages'] + sys.path"
</Location>
Alias /adminmedia /opt/python2.6/lib/python2.4/site-packages/django/
contrib/admin/media
<Location "/adminmedia">
SetHandler None
</Location>
Alias /media /data/hosting/cube/media
<Location "/media">
SetHandler None
</Location>
</VirtualHost>
### settings.py ###
# Copyright (C) 2010 Trinity Western University
# Django settings for cube project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Admin', '[email protected]'),
)
MANAGERS = ADMINS
DATABASE_ENGINE = '***'
DATABASE_NAME = '***'
DATABASE_USER = '***'
DATABASE_PASSWORD = '***'
DATABASE_HOST = '' # Set to empty string for localhost.
DATABASE_PORT = '' # Set to empty string for default.
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as
your
# system time zone.
TIME_ZONE = 'America/Vancouver'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-CA'
# Make sure you go into the database and set your domain name
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as
not
# to load the internationalization machinery.
USE_I18N = True
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = '/data/hosting/cube/media/'
# URL that handles the media served from MEDIA_ROOT. Make sure to use
a
# trailing slash if there is a path component (optional in other
cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = 'http://cube.twusa.ca/media/'
# URL prefix for admin media -- CSS, JavaScript and images. Make sure
to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/media/'
# Make this unique, and don't share it with anybody.
SECRET_KEY = '***'
# List of callables that know how to import templates from various
sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
# 'django.template.loaders.eggs.load_template_source',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)
ROOT_URLCONF = 'cube.urls'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/
django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
'/data/hosting/cube/templates'
)
TEMPLATE_CONTEXT_PROCESSORS = (
"django.core.context_processors.request",
"django.core.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media"
)
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.humanize',
'django.contrib.sessions',
'django.contrib.sites',
'cube.books',
)
LOGIN_URL = "/" # The url where the login view can be accessed
LOGIN_REDIRECT_URL = "books" #Where the login view should send users
by default after authentication
AUTHENTICATION_BACKENDS = (
# This Site is written to work with TWUPass
# If you don't want to use TWUPass, it will take a little bit of
decoupling
'cube.twupass.backend.TWUPassBackend',
'django.contrib.auth.backends.ModelBackend',
)
### Project Structure ###
/data/hosting/cube
/cube
/books
settings.py
(etc)
/media
/templates
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.