免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3403 | 回复: 1

Error importing middleware middleware.pagesize [复制链接]

论坛徽章:
0
发表于 2010-03-05 14:16 |显示全部楼层
我在Centos上面安装cnprog,服务器的IP地址是192.168.2.242

cnprog 安装在 /var/www/djangoapps/cnprog
目前已经可以在工程模式启动后,正常访问

我现在希望部署到apache上面去,mod_python 已经安装成功并在 httpd.conf 中加载了

我在 httpd.conf 的结尾处添加了下面一段
Listen 8000
<VirtualHost *:8000>
    DocumentRoot /var/www/djangoapps/cnprog
    <Location "/">
        SetHandler python-program
        PythonPath "['/var/www/djangoapps/'] + sys.path"
        PythonHandler django.core.handlers.modpython
        SetEnv DJANGO_SETTINGS_MODULE cnprog.settings_apache
        PythonAutoReload Off
        PythonDebug On
    </Location>
    Alias /site_media /var/www/djangoapps/cnprog/media
    Alias /media /usr/local/lib/python2.5/site-packages/django/contrib/admin/media
    <Location "/site_media">
        SetHandler None
    </Location>
    <Location "/media">
        SetHandler None
    </Location>
</VirtualHost>

重启apache后,访问 http://192.168.2.242:8000 ,出现下面的错误

MOD_PYTHON ERROR

ProcessId:      7337
Interpreter:    'localhost.localdomain'

ServerName:     'localhost.localdomain'
DocumentRoot:   '/var/www/djangoapps/cnprog'

URI:            '/'
Location:       '/'
Directory:      None
Filename:       '/var/www/djangoapps/cnprog/'
PathInfo:       ''

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

Traceback (most recent call last):

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

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

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

  File "/usr/local/lib/python2.5/site-packages/django/core/handlers/modpython.py", line 228, in handler
    return ModPythonHandler()(req)

  File "/usr/local/lib/python2.5/site-packages/django/core/handlers/modpython.py", line 191, in __call__
    self.load_middleware()

  File "/usr/local/lib/python2.5/site-packages/django/core/handlers/base.py", line 42, in load_middleware
    raise exceptions.ImproperlyConfigured, 'Error importing middleware %s: "%s"' % (mw_module, e)

ImproperlyConfigured: Error importing middleware middleware.pagesize: "No module named middleware.pagesize"


有没有朋友知道是为什么,应该如何解决呢,多谢了

论坛徽章:
0
发表于 2010-03-05 20:43 |显示全部楼层
No module named middleware.pagesize
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP