Deploying django app on Apache mod_python

前端 未结 5 2150
名媛妹妹
名媛妹妹 2021-02-11 07:55

I\'ve finished making a site in django called \'kazbah\', and I\'m trying to deploy.

All the code for the kazbah site is in /home/git/DjangoProjects/kazbah and my httpd.

5条回答
  •  执念已碎
    2021-02-11 08:51

    I've seen this a few times. Every time, it's been because I incorrectly set this line:

    SetEnv DJANGO_SETTINGS_MODULE kazbah.settings
    

    Even though it looked right, Django (actually python) was looking one folder off from the one I intended. Try tweaking it, changing it to:

    SetEnv DJANGO_SETTINGS_MODULE settings
    

    Also, you can tweak here:

    PythonPath "['/home/git/DjangoProjects'] + sys.path"
    

    It might be that you need to set it to:

    PythonPath "['/home/git/DjangoProjects/kazbah'] + sys.path"
    

    or something similar. Without seeing your actual folder setup, it's hard to know exactly. :)

提交回复
热议问题