I'm getting a 500:Internal error when i try to start my apache server with django. I tried the steps given in the previous questions Django with Apache 500 Error and Django Apache mod_wsgi 500 but neither of them did the trick.
My Wsgi file:
import os
import sys
sys.path = ['var/www/first'] + sys.path
sys.path.append('var/www/first')
os.eviron['DJANGO_SETTINGS_MODULE'] = 'first.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()`
My conf file:
<VirtualHost *:80>
WSGIScriptAlias / /home/alok/Documents/first.wsgi
Servername website.com
Alias /static /var/www/first/static/
<Directory /var/www/first/>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>`
I tried changing the permissions to 777 and the folder for wsgi file but still it won't work. Any suggestions?
os.eviron
is a typo. You mean os.environ
.
Your Apache error log probably would have shown you that.
1) I don't understand why you tried to extend sys.path two times.
2) I think the path should be absolute. /var/www/first/
3) Check your ALLOWED_HOSTS = ['your.domain/ip-address'] in settings.py file
I'm getting a 500:Internal error when i try to start my apache server with django. I tried the steps given in the previous questions Django with Apache 500 Error and Django Apache mod_wsgi 500 but neither of them did the trick.
My Wsgi file:
import os
import sys
sys.path = ['var/www/first'] + sys.path
sys.path.append('var/www/first')
os.eviron['DJANGO_SETTINGS_MODULE'] = 'first.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()`
My conf file:
<VirtualHost *:80>
WSGIScriptAlias / /home/alok/Documents/first.wsgi
Servername website.com
Alias /static /var/www/first/static/
<Directory /var/www/first/>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>`
I tried changing the permissions to 777 and the folder for wsgi file but still it won't work. Any suggestions?
os.eviron
is a typo. You mean os.environ
.
Your Apache error log probably would have shown you that.
1) I don't understand why you tried to extend sys.path two times.
2) I think the path should be absolute. /var/www/first/
3) Check your ALLOWED_HOSTS = ['your.domain/ip-address'] in settings.py file
0 commentaires:
Enregistrer un commentaire