先上ports.conf及相关文件:
ports.conf
# If you just change the port or add more ports here, you will likely also # have to change the VirtualHost statement in # /etc/apache2/sites-enabled/000-default.conf NameVirtualHost *:80 Listen 80 NameVirtualHost *:81 Listen 81Listen 443 Listen 443 # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Django项目一sites-available/conf文件:
ServerName xxx ServerAdmin xxx WSGIscriptAlias / /var/www/xxx/xxx/wsgi.py Alias /media/ /var/www/xxx/media/ Alias /static/ /var/www/xxx/static/ Require all granted Require all granted Require all granted ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined Require all granted
Django项目二sites-available/conf文件:
ServerName xxx ServerAdmin xxx WSGIscriptAlias / /var/www/QXTechnology/QXTechnology/wsgi.py Alias /media/ /var/www/QXTechnology/media/ Alias /static/ /var/www/QXTechnology/static/ Require all granted Require all granted Require all granted ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined Require all granted
出现的现象是:打开网站一,则再打开网站二出现崩溃;先打开网站二,则反之。
最后发现问题出在wsgi.py文件。
其中一个wsgi.py文件我只设置了os.environ.setdefault(‘DJANGO_SETTINGS_MODULE’, ‘xxx.settings’),而漏了os.environ[‘DJANGO_SETTINGS_MODULE’] = ‘xxx.settings’。
最后两个文件都设置了即解决了问题。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)