Django newbie deployment question - ImportError: Could not import settings 'settings'

前端 未结 2 2100
离开以前
离开以前 2021-02-07 12:34

The app runs fine using django internal server however when I use apache + mod_python I get the below error


  File \"/usr/local/lib/python2.6/dist-package         


        
2条回答
  •  梦毁少年i
    2021-02-07 13:35

    Try changing to the following:

    
        SetHandler python-program
        PythonHandler django.core.handlers.modpython
        SetEnv DJANGO_SETTINGS_MODULE mysite.settings
        PythonOption django.root /mysite
        PythonPath "['/root/djangoprojects', '/var/www'] + sys.path"
        PythonDebug On
    
    

    Use no "/" at the end of the PythonPath entries (that may be an issue, I had problems with that at least on Windows).

    The entries '/root/djangoprojects/mysite','/root/djangoprojects/mysite/polls' are not needed since you will be referring to your modules by full name (i.e. mysite.sttings means the settings module inside the mysite package, which is the correct way to access it in the PythonPath /root/djangoprojects).

提交回复
热议问题