0

I'm trying to get Apache2 to host my Django project located in /var/www/tbg/. I get an Internal Server Error (500). I have already installed libapache2-mod-wsgi and

My files are as follows:

project.wsgi file: /var/www/tbg/django.wsgi

import os
import sys
sys.path = ['/var/www/tbg'] + sys.path
os.environ['DJANGO_SETTINGS_MODULE'] = 'tbg.settings'
import django.core.handlers.wsgi
XSendFile On
application = django.core.handlers.wsgi.WSGIHandler()

sites-available/127.0.0.1 file:

<VirtualHost *:80>
WSGIScriptAlias / /var/www/tbg/django.wsgi

ServerName 127.0.0.1 
Alias /static /usr/local/lib/python2.6/dist-packages/django/contrib/admin/static/
Alias /media /var/www/tbg/media/

XSendFile On

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

httpd.conf file:

WSGIScriptAlias / /var/www/tbg/tbg/wsgi.py
WSGIPythonPath /var/www/tbg

Alias /static /var/www/tbg/static/
Alias /media /var/www/tbg/media/

XSendFile On

<Directory /var/www/tbg/>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>

I think those are all of the important files. Let me know what more information you need.

1 Answer 1

0

You need to setup error reporting so you could see error messages about what exactly is wrong. You may find this thread useful: https://stackoverflow.com/questions/8007176/500-error-without-anything-in-the-apache-logs.

1
  • While the link might provide an answer it can quickly become outdated. Please include the main points from the link in your answer. Thanks. Commented Jul 18, 2014 at 9:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .