I was using Django site on local machine with Ubuntu and have just uploaded but getting 500 internal server error and I am unable to understand the reason.
Seems like it is unable to see some modules, may be it is not looking at my settings file? The following is the error log for this issue, may be that reveal what is happening:
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] mod_wsgi (pid=23248): Exception occurred processing WSGI script '/var/www/kaasib/pypr$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] Traceback (most recent call last):
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 24$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] response = self.get_response(request)
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 17$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 22$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] return debug.technical_500_response(request, *exc_info)
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line 66, in te$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] html = reporter.get_traceback_html()
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line 276, in g$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] return t.render(c)
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 140, in$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] return self._render(context)
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 134, in$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] return self.nodelist.render(context)
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 823, in$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] bit = self.render_node(node, context)
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py", line 74, in$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] return node.render(context)
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py", line 84, in$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] output = self.filter_expression.resolve(context)
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 599, in$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] new_obj = func(obj, *arg_vals)
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/template/defaultfilters.py", li$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] return format(value, arg)
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/utils/dateformat.py", line 310,$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] return df.format(format_string)
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/utils/dateformat.py", line 33, $
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] pieces.append(force_unicode(getattr(self, piece)()))
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/utils/dateformat.py", line 214,$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] return self.format('D, j M Y H:i:s O')
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/utils/dateformat.py", line 33, $
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] pieces.append(force_unicode(getattr(self, piece)()))
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/utils/encoding.py", line 71, in$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] s = unicode(s)
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 121,$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] return func(*self.__args, **self.__kw)
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py",$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] return _trans.ugettext(message)
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] return do_translate(message, 'ugettext')
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] _default = translation(settings.LANGUAGE_CODE)
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] default_translation = _fetch(settings.LANGUAGE_CODE)
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] app = import_module(appname)
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, i$
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] __import__(name)
[Sat Dec 29 02:59:37 2012] [error] [client 139.190.233.10] ImportError: No module named company
Here is content of httpd.conf file:
WSGIPythonPath /var/www/kaasib/pyproject/kaasib/
<Directory /var/www/kaasib/pyproject/kaasib/kaasib/>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
WSGISCRIPTAlis line is in vhost file that is in site-available. And following is content of wsgi file:
"""
WSGI config for kaasib project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting.
Usually you will have the standard Django WSGI application here, but it also
might make sense to replace the whole Django WSGI application with a custom one
that later delegates to the Django one. For example, you could introduce WSGI
middleware here, or combine a Django application with an application of another
framework.
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "kaasib.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)