2013-07-02 122 views
1

我有以下問題與mod_wsgi和Django-CMS。Django-CMS與mod_wsgi

這裏是我的httpd.conf片段:

LoadModule wsgi_module    /usr/lib/apache2/modules/mod_wsgi.so  
WSGIScriptAlias /cms /home/user/apps/django_cms/django_cms/site.wsgi 

當我打開我的SERVER_IP/CMS它重定向我SERVER_IP/PL/CMS /並返回404錯誤。波蘭語是唯一的語言,我可以避免重定向或將其更改爲/ cms/pl而不是/ pl/cms?
這裏是我的site.wsgi:

import os, sys 
sys.path.append('/home/user/apps/') 
sys.path.append('/home/user/apps/django_cms/') 
sys.path.append('/home/user/apps/django_cms/django_cms/') 

os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' 

import django.core.handlers.wsgi 

application = django.core.handlers.wsgi.WSGIHandler() 

回答

0

在你的settings.py文件,嘗試註釋掉:

#LANGUAGES = [ 
# ('pl', 'Polish'), 
#] 

確保您的httpd.conf文件有一個目錄部分:

<Directory "/home/user/apps/django_cms"> 
    Order deny,allow 
    Allow from all 
    AddHandler wsgi-script .wsgi 
    SetHandler wsgi-script 
    Require all granted 
</Directory> 

在您的site.wsgi文件中,替換爲:

import django.core.handlers.wsgi 
application = django.core.handlers.wsgi.WSGIHandler() 

有:

from django.core.wsgi import get_wsgi_application 
application = get_wsgi_application() 
+0

現在我歌廳錯誤:「配置錯誤:無法進行認證。 AuthType not set !:/cms「,這裏是我的httpd.conf:http://dpaste.com/hold/1287859/ – Djent

+0

它爲我工作,我沒有做任何其他的site.wsgi – 2014-03-12 16:17:44