简体   繁体   中英

Django in apache with mod_wsgi confused by os.environ mysite.settings and settings.py

Is settings.py the same as mysite.settings from this example here:

http://django.readthedocs.io/en/1.2.X/howto/deployment/modwsgi.html

It seems ambiguous to me if it is the same thing or not, my app has a settings.py in it but it seems like this isn't the same as mysite.settings spoken of in the docs. I do have my app running with$ python manage.py runserver just fine on centos, and even see apaches test page on the same box so i know apache is running. Was going through the doc above to try to get apache to server the django app and thats where I got confused as to what it is really asking for...

(also the apache folder didn't exist so I added that and created a django.wsgi with the code below that I think was the right thing to do).

Almost looks like I have to setup a sys.path somewhere?

https://code.google.com/archive/p/modwsgi/wikis/IntegrationWithDjango.wiki

When you define:

DJANGO_SETTINGS_MODULE = 'mysite.settings'

Django looks up for settings.py file in mysite folder. mysite folder has to be on your PYTHONPATH. Make sure you set your PYTHONPATH to something like:

export PYTHONPATH=/home/work/project:/home/work/project/project:$PYTHONPATH

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM