Apache 500内部服务器错误 - DJANGO

时间:2014-12-13 19:38:04

标签: python html django apache ubuntu

我遇到以下错误消息的问题:

  

错误:“500内部服务器错误”

在apache2上启动django项目。

APACHE2CONFFİLE:

<VirtualHost *:80>
ServerAdmin biisguzar@gmail.com
ServerName asistan.com
ServerAlias www.asistan.com
DocumentRoot /var/www/asistan


Alias /static/ /var/www/asistan/static/
WSGIScriptAlias / "/var/www/asistan/asistan/wsgi.py"


<Directory /var/www/asistan>
Order allow,deny
Allow from all
</Directory>


</VirtualHost>

DJANGOWSGİ.PYFİLE:

import os,sys
sys.path.append('/var/www')
sys.path.append('/var/www/asistan')

sys.path.append('/var/www/asistan/asistan')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "asistan.settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

PAGE SS:

enter image description here

1 个答案:

答案 0 :(得分:2)

在您的settings.py中,确保已将变量ALLOWED_HOSTS设置为包含域名。如果不是,只要变量DEBUG设置为False,您就会收到500错误。例如:

ALLOWED_HOSTS = ['mydomain.com']

Here's the documentation for ALLOWED_HOSTS