【发布时间】:2019-01-26 11:04:36
【问题描述】:
我已经尝试了这么多,感觉我被卡住了,没有得到任何地方 Apache 给出的错误是
ModuleNotFoundError: 没有名为“wearpretty.settings”的模块
我正在使用 蟒蛇3.6, Django2.1, 阿帕奇2, libapache2-mod-wsgi-py3
以下是本文使用的文件。
wsgi.py
>import os
from django.core.wsgi import get_wsgi_application
os.environ["DJANGO_SETTINGS_MODULE"] = "wearpretty.settings"
application = get_wsgi_application()
virtualhost.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName lhwearpretty.com
ServerAlias www.lhwearpretty.com
DocumentRoot /var/www/myprojects/wearpretty/wearpretty/wearpretty
<Directory /var/www/myprojects/wearpretty/wearpretty/wearpretty>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess lhwearpretty.com python-home=/var/www/myprojects/wearpretty/venv python-path=/var/www/myprojects/wearpretty
WSGIProcessGroup lhwearpretty.com
WSGIScriptAlias / /var/www/myprojects/wearpretty/wearpretty/wearpretty/wsgi.py
Alias /static/ /var/www/myprojects/wearpretty/wearpretty/static/
<Directory /var/www/myprojects/wearpretty/wearpretty/static>
Require all granted
</Directory>
</VirtualHost>
【问题讨论】:
标签: django python-3.x apache mod-wsgi