Deploy django1.8 in a production server Apache+ mod_wsgi - django

I'm trying to do the deploy at my project with django1.8, using apache 2.x and mod_wsgi, the structure of my project is (pd: mi proyect is in /var/www)
projectdjango
apps -- (my django-apps)
....
projectdjango
settings
local.py
staging.py
url.py
static
templates
....
manage.py
projectdjango.wsgi
the code I'm using for the httpd.conf is
<VirtualHost *:80>
ServerName projectdjango.com
DocumentRoot /var/www/projectdjango
<Directory /var/www/ >
Order allow,deny
Allow from all
</Directory>
WSGIDaemonProcess projectdjango.com processes=2 threads=15
WSGIProcessGroup projectdjango.com
WSGIScriptAlias / /var/www/projectdjango/projectdjango.wsgi
</VirtualHost>
and the code for projectdjango.wsgi is
import os
import sys
sys.path.append('/var/www')
sys.path.append('/var/www/projectdjango')
os.environ['DJANGO_SETTINGS_MODULE'] = 'projectdjango.settings.staging'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
error.log
[Thu Apr 23 16:44:48.540206 2015] [core:notice] [pid 21662:tid 140482308327296] AH00094: Command line: '/usr/sbin/apache2'
[Thu Apr 23 16:45:43.715053 2015] [mpm_event:notice] [pid 21662:tid 140482308327296] AH00491: caught SIGTERM, shutting down
[Thu Apr 23 16:45:44.907958 2015] [mpm_event:notice] [pid 21779:tid 140246657443712] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming n$
[Thu Apr 23 16:45:44.908339 2015] [core:notice] [pid 21779:tid 140246657443712] AH00094: Command line: '/usr/sbin/apache2'
[Thu Apr 23 16:48:31.071450 2015] [mpm_event:notice] [pid 21779:tid 140246657443712] AH00491: caught SIGTERM, shutting down
[Thu Apr 23 16:48:32.282889 2015] [mpm_event:notice] [pid 21909:tid 140394885306240] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming n$
[Thu Apr 23 16:48:32.283273 2015] [core:notice] [pid 21909:tid 140394885306240] AH00094: Command line: '/usr/sbin/apache2'
[Thu Apr 23 21:49:47.620133 2015] [:error] [pid 21911:tid 140394723014400] No handlers could be found for logger "django.request"
[Thu Apr 23 21:49:47.842564 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] mod_wsgi (pid=21911): Exception occurred processing WSGI script '/$
[Thu Apr 23 21:49:47.842699 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] Traceback (most recent call last):
[Thu Apr 23 21:49:47.842771 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] File "/usr/local/lib/python2.7/dist-packages/django/core/handler$
[Thu Apr 23 21:49:47.844350 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] response = self.get_response(request)
[Thu Apr 23 21:49:47.844455 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] File "/usr/local/lib/python2.7/dist-packages/django/core/handler$
[Thu Apr 23 21:49:47.844851 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] response = self.handle_uncaught_exception(request, resolver, s$
[Thu Apr 23 21:49:47.844904 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] File "/usr/local/lib/python2.7/dist-packages/django/core/handler$
[Thu Apr 23 21:49:47.844979 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] return debug.technical_500_response(request, *exc_info)
[Thu Apr 23 21:49:47.845023 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] File "/usr/local/lib/python2.7/dist-packages/django/views/debug.$
[Thu Apr 23 21:49:47.846871 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] html = reporter.get_traceback_html()
[Thu Apr 23 21:49:47.846981 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] File "/usr/local/lib/python2.7/dist-packages/django/views/debug.$
[Thu Apr 23 21:49:47.847070 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] return t.render(c)
[Thu Apr 23 21:49:47.847112 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] File "/usr/local/lib/python2.7/dist-packages/django/template/bas$
[Thu Apr 23 21:49:47.848209 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] return self._render(context)
[Thu Apr 23 21:49:47.848293 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] File "/usr/local/lib/python2.7/dist-packages/django/template/bas$
[Thu Apr 23 21:49:47.848394 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] return self.nodelist.render(context)
[Thu Apr 23 21:49:47.850682 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] File "/usr/local/lib/python2.7/dist-packages/django/utils/encodi$
[Thu Apr 23 21:49:47.851014 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] s = six.text_type(s)
[Thu Apr 23 21:49:47.851063 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] File "/usr/local/lib/python2.7/dist-packages/django/utils/functi$
[Thu Apr 23 21:49:47.851538 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] return func(*self.__args, **self.__kw)
[Thu Apr 23 21:49:47.851600 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] File "/usr/local/lib/python2.7/dist-packages/django/utils/transl$
[Thu Apr 23 21:49:47.851879 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] return _trans.ugettext(message)
[Thu Apr 23 21:49:47.851963 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] File "/usr/local/lib/python2.7/dist-packages/django/utils/transl$
[Thu Apr 23 21:49:47.852729 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] return do_translate(message, 'ugettext')
[Thu Apr 23 21:49:47.852805 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] File "/usr/local/lib/python2.7/dist-packages/django/utils/transl$
[Thu Apr 23 21:49:47.852891 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] _default = _default or translation(settings.LANGUAGE_CODE)
[Thu Apr 23 21:49:47.852933 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] File "/usr/local/lib/python2.7/dist-packages/django/utils/transl$
[Thu Apr 23 21:49:47.852997 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] _translations[language] = DjangoTranslation(language)
[Thu Apr 23 21:49:47.853037 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] File "/usr/local/lib/python2.7/dist-packages/django/utils/transl$
[Thu Apr 23 21:49:47.853102 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] self._add_installed_apps_translations()
[Thu Apr 23 21:49:47.853143 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] File "/usr/local/lib/python2.7/dist-packages/django/utils/transl$
[Thu Apr 23 21:49:47.853208 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] "The translation infrastructure cannot be initialized before t$
[Thu Apr 23 21:49:47.853392 2015] [:error] [pid 21911:tid 140394723014400] [remote 127.0.0.1:16955] AppRegistryNotReady: The translation infrastructure cannot be init$
I hope someone can help me what i'm doing wrong

Related

Elastic Beanstalk won't find/use my requirements.txt file and so it cannot find the module "django"

I'm trying to deploy a python web app using django and have successfully setup the EB environment but for some reason, it's not using my requirements.txt file to install the required modules (django and pytz). I see no reference to an invalid requirements.txt so I don't think that's the issue. Here is a file hierarchy and the latest log.
FirstWebApp/
.elasticbeanstalk/
config.yml
mysite/
#..
polls/
#..
db.sqlite3
manage.py
requirements.txt
[Sat Sep 01 21:08:01.508757 2018] [mpm_prefork:notice] [pid 7866] AH00169: caught SIGTERM, shutting down
[Sat Sep 01 21:08:02.599699 2018] [suexec:notice] [pid 11160] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat Sep 01 21:08:02.615594 2018] [so:warn] [pid 11160] AH01574: module wsgi_module is already loaded, skipping
[Sat Sep 01 21:08:02.617699 2018] [http2:warn] [pid 11160] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Sat Sep 01 21:08:02.617712 2018] [http2:warn] [pid 11160] AH02951: mod_ssl does not seem to be enabled
[Sat Sep 01 21:08:02.618263 2018] [lbmethod_heartbeat:notice] [pid 11160] AH02282: No slotmem from mod_heartmonitor
[Sat Sep 01 21:08:02.618326 2018] [:warn] [pid 11160] mod_wsgi: Compiled for Python/3.6.2.
[Sat Sep 01 21:08:02.618331 2018] [:warn] [pid 11160] mod_wsgi: Runtime using Python/3.6.5.
[Sat Sep 01 21:08:02.620634 2018] [mpm_prefork:notice] [pid 11160] AH00163: Apache/2.4.33 (Amazon) mod_wsgi/3.5 Python/3.6.5 configured -- resuming normal operations
[Sat Sep 01 21:08:02.620651 2018] [core:notice] [pid 11160] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Sat Sep 01 21:08:05.381076 2018] [:error] [pid 11165] [remote 127.0.0.1:0] mod_wsgi (pid=11165): Target WSGI script '/opt/python/current/app/mysite/wsgi.py' cannot be loaded as Python module.
[Sat Sep 01 21:08:05.381116 2018] [:error] [pid 11165] [remote 127.0.0.1:0] mod_wsgi (pid=11165): Exception occurred processing WSGI script '/opt/python/current/app/mysite/wsgi.py'.
[Sat Sep 01 21:08:05.381287 2018] [:error] [pid 11165] [remote 127.0.0.1:0] Traceback (most recent call last):
[Sat Sep 01 21:08:05.381309 2018] [:error] [pid 11165] [remote 127.0.0.1:0] File "/opt/python/current/app/mysite/wsgi.py", line 12, in <module>
[Sat Sep 01 21:08:05.381313 2018] [:error] [pid 11165] [remote 127.0.0.1:0] from django.core.wsgi import get_wsgi_application
[Sat Sep 01 21:08:05.381326 2018] [:error] [pid 11165] [remote 127.0.0.1:0] ModuleNotFoundError: No module named 'django'
[Sat Sep 01 21:08:06.384353 2018] [:error] [pid 11165] [remote 127.0.0.1:252] mod_wsgi (pid=11165): Target WSGI script '/opt/python/current/app/mysite/wsgi.py' cannot be loaded as Python module.
[Sat Sep 01 21:08:06.384403 2018] [:error] [pid 11165] [remote 127.0.0.1:252] mod_wsgi (pid=11165): Exception occurred processing WSGI script '/opt/python/current/app/mysite/wsgi.py'.
[Sat Sep 01 21:08:06.384505 2018] [:error] [pid 11165] [remote 127.0.0.1:252] Traceback (most recent call last):
[Sat Sep 01 21:08:06.384528 2018] [:error] [pid 11165] [remote 127.0.0.1:252] File "/opt/python/current/app/mysite/wsgi.py", line 12, in <module>
[Sat Sep 01 21:08:06.384531 2018] [:error] [pid 11165] [remote 127.0.0.1:252] from django.core.wsgi import get_wsgi_application
[Sat Sep 01 21:08:06.384560 2018] [:error] [pid 11165] [remote 127.0.0.1:252] ModuleNotFoundError: No module named 'django'
[Sat Sep 01 21:08:07.387609 2018] [:error] [pid 11165] [remote 127.0.0.1:2304] mod_wsgi (pid=11165): Target WSGI script '/opt/python/current/app/mysite/wsgi.py' cannot be loaded as Python module.
[Sat Sep 01 21:08:07.387656 2018] [:error] [pid 11165] [remote 127.0.0.1:2304] mod_wsgi (pid=11165): Exception occurred processing WSGI script '/opt/python/current/app/mysite/wsgi.py'.
[Sat Sep 01 21:08:07.387725 2018] [:error] [pid 11165] [remote 127.0.0.1:2304] Traceback (most recent call last):
[Sat Sep 01 21:08:07.387744 2018] [:error] [pid 11165] [remote 127.0.0.1:2304] File "/opt/python/current/app/mysite/wsgi.py", line 12, in <module>
[Sat Sep 01 21:08:07.387748 2018] [:error] [pid 11165] [remote 127.0.0.1:2304] from django.core.wsgi import get_wsgi_application
[Sat Sep 01 21:08:07.387761 2018] [:error] [pid 11165] [remote 127.0.0.1:2304] ModuleNotFoundError: No module named 'django'
[Sat Sep 01 21:08:08.390656 2018] [:error] [pid 11165] [remote 127.0.0.1:2304] mod_wsgi (pid=11165): Target WSGI script '/opt/python/current/app/mysite/wsgi.py' cannot be loaded as Python module.
[Sat Sep 01 21:08:08.390700 2018] [:error] [pid 11165] [remote 127.0.0.1:2304] mod_wsgi (pid=11165): Exception occurred processing WSGI script '/opt/python/current/app/mysite/wsgi.py'.
[Sat Sep 01 21:08:08.390770 2018] [:error] [pid 11165] [remote 127.0.0.1:2304] Traceback (most recent call last):
[Sat Sep 01 21:08:08.390790 2018] [:error] [pid 11165] [remote 127.0.0.1:2304] File "/opt/python/current/app/mysite/wsgi.py", line 12, in <module>
[Sat Sep 01 21:08:08.390793 2018] [:error] [pid 11165] [remote 127.0.0.1:2304] from django.core.wsgi import get_wsgi_application
[Sat Sep 01 21:08:08.390807 2018] [:error] [pid 11165] [remote 127.0.0.1:2304] ModuleNotFoundError: No module named 'django'
I just had to commit the requirements.txt file. Django only looks at whatever files have been committed.

Internal Server Error Django/apache

My Django app was working fine, but now I'm getting a server error, the last thing I did was a reboot to my Centos7 Server and now I'm getting this error:
and this are my logs I'm using apache:
[Thu Mar 30 14:04:10.571843 2017] [:error] [pid 11335] [remote 10.221.50.100:24] mod_wsgi (pid=11335): Target WSGI script '/opt/btsystem/BTSystem/wsgi.py' cannot be loaded as Python module.
[Thu Mar 30 14:04:10.571991 2017] [:error] [pid 11335] [remote 10.221.50.100:24] mod_wsgi (pid=11335): Exception occurred processing WSGI script '/opt/btsystem/BTSystem/wsgi.py'.
[Thu Mar 30 14:04:10.572263 2017] [:error] [pid 11335] [remote 10.221.50.100:24] Traceback (most recent call last):
[Thu Mar 30 14:04:10.572544 2017] [:error] [pid 11335] [remote 10.221.50.100:24] File "/opt/btsystem/BTSystem/wsgi.py", line 16, in <module>
[Thu Mar 30 14:04:10.572795 2017] [:error] [pid 11335] [remote 10.221.50.100:24] application = get_wsgi_application()
[Thu Mar 30 14:04:10.572919 2017] [:error] [pid 11335] [remote 10.221.50.100:24] File "/usr/lib64/python2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Thu Mar 30 14:04:10.573054 2017] [:error] [pid 11335] [remote 10.221.50.100:24] django.setup(set_prefix=False)
[Thu Mar 30 14:04:10.573107 2017] [:error] [pid 11335] [remote 10.221.50.100:24] File "/usr/lib64/python2.7/site-packages/django/__init__.py", line 22, in setup
[Thu Mar 30 14:04:10.573170 2017] [:error] [pid 11335] [remote 10.221.50.100:24] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[Thu Mar 30 14:04:10.573261 2017] [:error] [pid 11335] [remote 10.221.50.100:24] File "/usr/lib64/python2.7/site-packages/django/utils/log.py", line 75, in configure_logging
[Thu Mar 30 14:04:10.573312 2017] [:error] [pid 11335] [remote 10.221.50.100:24] logging_config_func(logging_settings)
[Thu Mar 30 14:04:10.573369 2017] [:error] [pid 11335] [remote 10.221.50.100:24] File "/usr/lib64/python2.7/logging/config.py", line 803, in dictConfig
[Thu Mar 30 14:04:10.573409 2017] [:error] [pid 11335] [remote 10.221.50.100:24] dictConfigClass(config).configure()
[Thu Mar 30 14:04:10.573455 2017] [:error] [pid 11335] [remote 10.221.50.100:24] File "/usr/lib64/python2.7/logging/config.py", line 585, in configure
[Thu Mar 30 14:04:10.573501 2017] [:error] [pid 11335] [remote 10.221.50.100:24] '%r: %s' % (name, e))
[Thu Mar 30 14:04:10.573567 2017] [:error] [pid 11335] [remote 10.221.50.100:24] ValueError: Unable to configure handler 'file': [Errno 13] Permission denied: '/opt/btsystem-logs/btsystem-debug.log'
Any idea?
The last line shows that Django doesn't have permission to write to the configured log file.
[Thu Mar 30 14:04:10.573567 2017] [:error] [pid 11335] [remote 10.221.50.100:24] ValueError: Unable to configure handler 'file': [Errno 13] Permission denied: '/opt/btsystem-logs/btsystem-debug.log'
Make sure the file /opt/btsystem-logs/btsystem-debug.log is writeable by the user running the Django server.
The main problem was that I needed to do the following to enable the virtual host from Apache:
firewall-cmd --get-active-zones
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload
Needed to open the ports.

Django works fine on local host,but when using eb deploy and viewing it in the browser it comes up with a 500 error?

Im not sure what i am, doing wrong, when on my Django app, I run the app locally and it works fine with Amazon RDS. But when I deploy(eb deploy) then use (eb open) it doesn't work. It comes up with a 500 error. Any ideas on how i could fix this? Thanks!
This is the error in the logs:
[Fri Nov 18 11:08:32.441246 2016] [:error] [pid 10749] [remote 127.0.0.1:27580] apps.populate(settings.INSTALLED_APPS)
[Fri Nov 18 11:08:32.441251 2016] [:error] [pid 10749] [remote 127.0.0.1:27580] File "/opt/python/run/venv/lib/python2.7/site-packages/django/apps/registry.py", line 78, in populate
[Fri Nov 18 11:08:32.441261 2016] [:error] [pid 10749] [remote 127.0.0.1:27580] raise RuntimeError("populate() isn't reentrant")
[Fri Nov 18 11:08:32.441274 2016] [:error] [pid 10749] [remote 127.0.0.1:27580] RuntimeError: populate() isn't reentrant
[Fri Nov 18 11:08:33.444202 2016] [:error] [pid 10749] [remote 127.0.0.1:27580] mod_wsgi (pid=10749): Target WSGI script '/opt/python/current/app/hhh/wsgi.py' cannot be loaded as Python module.
[Fri Nov 18 11:08:33.444225 2016] [:error] [pid 10749] [remote 127.0.0.1:27580] mod_wsgi (pid=10749): Exception occurred processing WSGI script '/opt/python/current/app/hhh/wsgi.py'.
[Fri Nov 18 11:08:33.444239 2016] [:error] [pid 10749] [remote 127.0.0.1:27580] Traceback (most recent call last):
[Fri Nov 18 11:08:33.444254 2016] [:error] [pid 10749] [remote 127.0.0.1:27580] File "/opt/python/current/app/hhh/wsgi.py", line 16, in <module>
[Fri Nov 18 11:08:33.444279 2016] [:error] [pid 10749] [remote 127.0.0.1:27580] application = get_wsgi_application()
[Fri Nov 18 11:08:33.444287 2016] [:error] [pid 10749] [remote 127.0.0.1:27580] File "/opt/python/run/venv/lib/python2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Fri Nov 18 11:08:33.444300 2016] [:error] [pid 10749] [remote 127.0.0.1:27580] django.setup()
[Fri Nov 18 11:08:33.444306 2016] [:error] [pid 10749] [remote 127.0.0.1:27580] File "/opt/python/run/venv/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
[Fri Nov 18 11:08:33.444315 2016] [:error] [pid 10749] [remote 127.0.0.1:27580] apps.populate(settings.INSTALLED_APPS)
[Fri Nov 18 11:08:33.444320 2016] [:error] [pid 10749] [remote 127.0.0.1:27580] File "/opt/python/run/venv/lib/python2.7/site-packages/django/apps/registry.py", line 78, in populate
[Fri Nov 18 11:08:33.444329 2016] [:error] [pid 10749] [remote 127.0.0.1:27580] raise RuntimeError("populate() isn't reentrant")
[Fri Nov 18 11:08:33.444342 2016] [:error] [pid 10749] [remote 127.0.0.1:27580] RuntimeError: populate() isn't reentrant
[Fri Nov 18 11:09:06.702445 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] mod_wsgi (pid=10749): Target WSGI script '/opt/python/current/app/hhh/wsgi.py' cannot be loaded as Python module.
[Fri Nov 18 11:09:06.702472 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] mod_wsgi (pid=10749): Exception occurred processing WSGI script '/opt/python/current/app/hhh/wsgi.py'.
[Fri Nov 18 11:09:06.702489 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] Traceback (most recent call last):
[Fri Nov 18 11:09:06.702506 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] File "/opt/python/current/app/hhh/wsgi.py", line 16, in <module>
[Fri Nov 18 11:09:06.702530 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] application = get_wsgi_application()
[Fri Nov 18 11:09:06.702538 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] File "/opt/python/run/venv/lib/python2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Fri Nov 18 11:09:06.702551 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] django.setup()
[Fri Nov 18 11:09:06.702557 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] File "/opt/python/run/venv/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
[Fri Nov 18 11:09:06.702566 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] apps.populate(settings.INSTALLED_APPS)
[Fri Nov 18 11:09:06.702572 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] File "/opt/python/run/venv/lib/python2.7/site-packages/django/apps/registry.py", line 78, in populate
[Fri Nov 18 11:09:06.702582 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] raise RuntimeError("populate() isn't reentrant")
[Fri Nov 18 11:09:06.702595 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] RuntimeError: populate() isn't reentrant
[Fri Nov 18 11:12:26.190170 2016] [:error] [pid 10749] [remote 172.31.40.17:29884] mod_wsgi (pid=10749): Target WSGI script '/opt/python/current/app/hhh/wsgi.py' cannot be loaded as Python module.
[Fri Nov 18 11:12:26.190197 2016] [:error] [pid 10749] [remote 172.31.40.17:29884] mod_wsgi (pid=10749): Exception occurred processing WSGI script '/opt/python/current/app/hhh/wsgi.py'.
[Fri Nov 18 11:12:26.190232 2016] [:error] [pid 10749] [remote 172.31.40.17:29884] Traceback (most recent call last):
[Fri Nov 18 11:12:26.190249 2016] [:error] [pid 10749] [remote 172.31.40.17:29884] File "/opt/python/current/app/hhh/wsgi.py", line 16, in <module>
[Fri Nov 18 11:12:26.190272 2016] [:error] [pid 10749] [remote 172.31.40.17:29884] application = get_wsgi_application()
[Fri Nov 18 11:12:26.190280 2016] [:error] [pid 10749] [remote 172.31.40.17:29884] File "/opt/python/run/venv/lib/python2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Fri Nov 18 11:12:26.190292 2016] [:error] [pid 10749] [remote 172.31.40.17:29884] django.setup()
[Fri Nov 18 11:12:26.190297 2016] [:error] [pid 10749] [remote 172.31.40.17:29884] File "/opt/python/run/venv/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
[Fri Nov 18 11:12:26.190305 2016] [:error] [pid 10749] [remote 172.31.40.17:29884] apps.populate(settings.INSTALLED_APPS)
[Fri Nov 18 11:12:26.190310 2016] [:error] [pid 10749] [remote 172.31.40.17:29884] File "/opt/python/run/venv/lib/python2.7/site-packages/django/apps/registry.py", line 78, in populate
[Fri Nov 18 11:12:26.190319 2016] [:error] [pid 10749] [remote 172.31.40.17:29884] raise RuntimeError("populate() isn't reentrant")
[Fri Nov 18 11:12:26.190331 2016] [:error] [pid 10749] [remote 172.31.40.17:29884] RuntimeError: populate() isn't reentrant
[Fri Nov 18 11:13:06.986835 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] mod_wsgi (pid=10749): Target WSGI script '/opt/python/current/app/hhh/wsgi.py' cannot be loaded as Python module.
[Fri Nov 18 11:13:06.986861 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] mod_wsgi (pid=10749): Exception occurred processing WSGI script '/opt/python/current/app/hhh/wsgi.py'.
[Fri Nov 18 11:13:06.986878 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] Traceback (most recent call last):
[Fri Nov 18 11:13:06.986895 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] File "/opt/python/current/app/hhh/wsgi.py", line 16, in <module>
[Fri Nov 18 11:13:06.986918 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] application = get_wsgi_application()
[Fri Nov 18 11:13:06.986926 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] File "/opt/python/run/venv/lib/python2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Fri Nov 18 11:13:06.986939 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] django.setup()
[Fri Nov 18 11:13:06.986945 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] File "/opt/python/run/venv/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
[Fri Nov 18 11:13:06.986954 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] apps.populate(settings.INSTALLED_APPS)
[Fri Nov 18 11:13:06.986960 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] File "/opt/python/run/venv/lib/python2.7/site-packages/django/apps/registry.py", line 78, in populate
[Fri Nov 18 11:13:06.986969 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] raise RuntimeError("populate() isn't reentrant")
[Fri Nov 18 11:13:06.986982 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] RuntimeError: populate() isn't reentrant
[Fri Nov 18 11:13:32.432736 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] mod_wsgi (pid=10749): Target WSGI script '/opt/python/current/app/hhh/wsgi.py' cannot be loaded as Python module.
[Fri Nov 18 11:13:32.432761 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] mod_wsgi (pid=10749): Exception occurred processing WSGI script '/opt/python/current/app/hhh/wsgi.py'.
[Fri Nov 18 11:13:32.432777 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] Traceback (most recent call last):
[Fri Nov 18 11:13:32.432794 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] File "/opt/python/current/app/hhh/wsgi.py", line 16, in <module>
[Fri Nov 18 11:13:32.432821 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] application = get_wsgi_application()
[Fri Nov 18 11:13:32.432829 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] File "/opt/python/run/venv/lib/python2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Fri Nov 18 11:13:32.432853 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] django.setup()
[Fri Nov 18 11:13:32.432859 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] File "/opt/python/run/venv/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
[Fri Nov 18 11:13:32.432868 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] apps.populate(settings.INSTALLED_APPS)
[Fri Nov 18 11:13:32.432873 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] File "/opt/python/run/venv/lib/python2.7/site-packages/django/apps/registry.py", line 78, in populate
[Fri Nov 18 11:13:32.432883 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] raise RuntimeError("populate() isn't reentrant")
[Fri Nov 18 11:13:32.432895 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] RuntimeError: populate() isn't reentrant
[Fri Nov 18 11:14:36.671161 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] mod_wsgi (pid=10749): Target WSGI script '/opt/python/current/app/hhh/wsgi.py' cannot be loaded as Python module.
[Fri Nov 18 11:14:36.671186 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] mod_wsgi (pid=10749): Exception occurred processing WSGI script '/opt/python/current/app/hhh/wsgi.py'.
[Fri Nov 18 11:14:36.671202 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] Traceback (most recent call last):
[Fri Nov 18 11:14:36.671218 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] File "/opt/python/current/app/hhh/wsgi.py", line 16, in <module>
[Fri Nov 18 11:14:36.671242 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] application = get_wsgi_application()
[Fri Nov 18 11:14:36.671250 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] File "/opt/python/run/venv/lib/python2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Fri Nov 18 11:14:36.671262 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] django.setup()
[Fri Nov 18 11:14:36.671268 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] File "/opt/python/run/venv/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
[Fri Nov 18 11:14:36.671277 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] apps.populate(settings.INSTALLED_APPS)
[Fri Nov 18 11:14:36.671282 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] File "/opt/python/run/venv/lib/python2.7/site-packages/django/apps/registry.py", line 78, in populate
[Fri Nov 18 11:14:36.671292 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] raise RuntimeError("populate() isn't reentrant")
[Fri Nov 18 11:14:36.671304 2016] [:error] [pid 10749] [remote 172.31.40.17:31932] RuntimeError: populate() isn't reentrant
[Fri Nov 18 11:15:39.070645 2016] [:error] [pid 10749] [remote 172.31.40.17:27580] mod_wsgi (pid=10749): Target WSGI script '/opt/python/current/app/hhh/wsgi.py' cannot be loaded as Python module.
[Fri Nov 18 11:15:39.070671 2016] [:error] [pid 10749] [remote 172.31.40.17:27580] mod_wsgi (pid=10749): Exception occurred processing WSGI script '/opt/python/current/app/hhh/wsgi.py'.
[Fri Nov 18 11:15:39.070687 2016] [:error] [pid 10749] [remote 172.31.40.17:27580] Traceback (most recent call last):
[Fri Nov 18 11:15:39.070705 2016] [:error] [pid 10749] [remote 172.31.40.17:27580] File "/opt/python/current/app/hhh/wsgi.py", line 16, in <module>
[Fri Nov 18 11:15:39.070729 2016] [:error] [pid 10749] [remote 172.31.40.17:27580] application = get_wsgi_application()
[Fri Nov 18 11:15:39.070737 2016] [:error] [pid 10749] [remote 172.31.40.17:27580] File "/opt/python/run/venv/lib/python2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Fri Nov 18 11:15:39.070749 2016] [:error] [pid 10749] [remote 172.31.40.17:27580] django.setup()
[Fri Nov 18 11:15:39.070755 2016] [:error] [pid 10749] [remote 172.31.40.17:27580] File "/opt/python/run/venv/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
[Fri Nov 18 11:15:39.070773 2016] [:error] [pid 10749] [remote 172.31.40.17:27580] apps.populate(settings.INSTALLED_APPS)
[Fri Nov 18 11:15:39.070779 2016] [:error] [pid 10749] [remote 172.31.40.17:27580] File "/opt/python/run/venv/lib/python2.7/site-packages/django/apps/registry.py", line 78, in populate
[Fri Nov 18 11:15:39.070788 2016] [:error] [pid 10749] [remote 172.31.40.17:27580] raise RuntimeError("populate() isn't reentrant")
[Fri Nov 18 11:15:39.070801 2016] [:error] [pid 10749] [remote 172.31.40.17:27580] RuntimeError: populate() isn't reentrant
[Fri Nov 18 11:16:05.684829 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] mod_wsgi (pid=10749): Target WSGI script '/opt/python/current/app/hhh/wsgi.py' cannot be loaded as Python module.
[Fri Nov 18 11:16:05.684853 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] mod_wsgi (pid=10749): Exception occurred processing WSGI script '/opt/python/current/app/hhh/wsgi.py'.
[Fri Nov 18 11:16:05.684868 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] Traceback (most recent call last):
[Fri Nov 18 11:16:05.684885 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] File "/opt/python/current/app/hhh/wsgi.py", line 16, in <module>
[Fri Nov 18 11:16:05.684908 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] application = get_wsgi_application()
[Fri Nov 18 11:16:05.684915 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] File "/opt/python/run/venv/lib/python2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Fri Nov 18 11:16:05.684928 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] django.setup()
[Fri Nov 18 11:16:05.684934 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] File "/opt/python/run/venv/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
[Fri Nov 18 11:16:05.684943 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] apps.populate(settings.INSTALLED_APPS)
[Fri Nov 18 11:16:05.684949 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] File "/opt/python/run/venv/lib/python2.7/site-packages/django/apps/registry.py", line 78, in populate
[Fri Nov 18 11:16:05.684958 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] raise RuntimeError("populate() isn't reentrant")
[Fri Nov 18 11:16:05.684970 2016] [:error] [pid 10749] [remote 172.31.40.17:31676] RuntimeError: populate() isn't reentrant
Here is the WSGI file
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hhh.settings")
application = get_wsgi_application()

Apache 2.4 with mod_wsgi: Internal Server Error with wsgi.py

I am trying to deploy my django project on a windows server, using apache 2.4 with mod_wsgi and pythong 3.4.
Now when I could run apache just fine but I got Internal Server Error when going to localhost, I have this Internal Server Error. Then I looked at the error.log and found the following:
The 'Apache2.4' service is restarting.
The 'Apache2.4' service has restarted.
winnt:notice] [pid 7756:tid 528] AH00424: Parent: Received restart signal -- Restarting the server.
[Thu Sep 29 18:18:19.003503 2016] [wsgi:warn] [pid 7756:tid 528] mod_wsgi: Compiled for Python/3.4.2.
[Thu Sep 29 18:18:19.003503 2016] [wsgi:warn] [pid 7756:tid 528] mod_wsgi: Runtime using Python/3.4.3.
[Thu Sep 29 18:18:19.003503 2016] [mpm_winnt:notice] [pid 7756:tid 528] AH00455: Apache/2.4.23 (Win64) mod_wsgi/4.4.12 Python/3.4.3 configured -- resuming normal operations
[Thu Sep 29 18:18:19.003503 2016] [mpm_winnt:notice] [pid 7756:tid 528] AH00456: Apache Lounge VC10 Server built: Jul 9 2016 11:59:00
[Thu Sep 29 18:18:19.003503 2016] [core:notice] [pid 7756:tid 528] AH00094: Command line: 'C:\\Apache24\\bin\\httpd.exe -d C:/Apache24'
[Thu Sep 29 18:18:19.003503 2016] [mpm_winnt:notice] [pid 7756:tid 528] AH00418: Parent: Created child process 10400
[Thu Sep 29 18:18:19.347246 2016] [wsgi:warn] [pid 10400:tid 456] mod_wsgi: Compiled for Python/3.4.2.
[Thu Sep 29 18:18:19.347246 2016] [wsgi:warn] [pid 10400:tid 456] mod_wsgi: Runtime using Python/3.4.3.
[Thu Sep 29 18:18:19.987923 2016] [mpm_winnt:notice] [pid 10400:tid 456] AH00354: Child: Starting 64 worker threads.
[Thu Sep 29 18:18:21.003576 2016] [mpm_winnt:notice] [pid 7476:tid 460] AH00364: Child: All worker threads have exited.
[Thu Sep 29 18:18:27.175151 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] mod_wsgi (pid=10400): Target WSGI script 'C:/EquipmentCalibration/equipcal/wsgi.py' cannot be loaded as Python module.
[Thu Sep 29 18:18:27.175151 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] mod_wsgi (pid=10400): Exception occurred processing WSGI script 'C:/EquipmentCalibration/equipcal/wsgi.py'.
[Thu Sep 29 18:18:27.175151 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] Traceback (most recent call last):\r
[Thu Sep 29 18:18:27.175151 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] File "C:/EquipmentCalibration/equipcal/wsgi.py", line 16, in <module>\r
[Thu Sep 29 18:18:27.175151 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] application = get_wsgi_application()\r
[Thu Sep 29 18:18:27.176153 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] File "C:\\Python34\\lib\\site-packages\\django\\core\\wsgi.py", line 13, in get_wsgi_application\r
[Thu Sep 29 18:18:27.176153 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] django.setup(set_prefix=False)\r
[Thu Sep 29 18:18:27.177153 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] File "C:\\Python34\\lib\\site-packages\\django\\__init__.py", line 22, in setup\r
[Thu Sep 29 18:18:27.177153 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)\r
[Thu Sep 29 18:18:27.177153 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] File "C:\\Python34\\lib\\site-packages\\django\\conf\\__init__.py", line 53, in __getattr__\r
[Thu Sep 29 18:18:27.177153 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] self._setup(name)\r
[Thu Sep 29 18:18:27.178128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] File "C:\\Python34\\lib\\site-packages\\django\\conf\\__init__.py", line 41, in _setup\r
[Thu Sep 29 18:18:27.178128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] self._wrapped = Settings(settings_module)\r
[Thu Sep 29 18:18:27.178128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] File "C:\\Python34\\lib\\site-packages\\django\\conf\\__init__.py", line 97, in __init__\r
[Thu Sep 29 18:18:27.178128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] mod = importlib.import_module(self.SETTINGS_MODULE)\r
[Thu Sep 29 18:18:27.178128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] File "C:\\Python34\\Lib\\importlib\\__init__.py", line 109, in import_module\r
[Thu Sep 29 18:18:27.178128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] return _bootstrap._gcd_import(name[level:], package, level)\r
[Thu Sep 29 18:18:27.178128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] File "<frozen importlib._bootstrap>", line 2254, in _gcd_import\r
[Thu Sep 29 18:18:27.178128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] File "<frozen importlib._bootstrap>", line 2237, in _find_and_load\r
[Thu Sep 29 18:18:27.179154 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] File "<frozen importlib._bootstrap>", line 2212, in _find_and_load_unlocked\r
[Thu Sep 29 18:18:27.179154 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed\r
[Thu Sep 29 18:18:27.179154 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] File "<frozen importlib._bootstrap>", line 2254, in _gcd_import\r
[Thu Sep 29 18:18:27.179154 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] File "<frozen importlib._bootstrap>", line 2237, in _find_and_load\r
[Thu Sep 29 18:18:27.179154 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] File "<frozen importlib._bootstrap>", line 2224, in _find_and_load_unlocked\r
[Thu Sep 29 18:18:27.179154 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55759] ImportError: No module named 'equipcal'\r
[Thu Sep 29 18:18:27.199128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] mod_wsgi (pid=10400): Target WSGI script 'C:/EquipmentCalibration/equipcal/wsgi.py' cannot be loaded as Python module., referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.199128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] mod_wsgi (pid=10400): Exception occurred processing WSGI script 'C:/EquipmentCalibration/equipcal/wsgi.py'., referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.199128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] Traceback (most recent call last):\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.199128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] File "C:/EquipmentCalibration/equipcal/wsgi.py", line 16, in <module>\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.199128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] application = get_wsgi_application()\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.199128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] File "C:\\Python34\\lib\\site-packages\\django\\core\\wsgi.py", line 13, in get_wsgi_application\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.199128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] django.setup(set_prefix=False)\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.199128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] File "C:\\Python34\\lib\\site-packages\\django\\__init__.py", line 22, in setup\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.199128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.200129 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] File "C:\\Python34\\lib\\site-packages\\django\\conf\\__init__.py", line 53, in __getattr__\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.200129 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] self._setup(name)\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.200129 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] File "C:\\Python34\\lib\\site-packages\\django\\conf\\__init__.py", line 41, in _setup\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.200129 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] self._wrapped = Settings(settings_module)\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.200129 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] File "C:\\Python34\\lib\\site-packages\\django\\conf\\__init__.py", line 97, in __init__\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.200129 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] mod = importlib.import_module(self.SETTINGS_MODULE)\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.201128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] File "C:\\Python34\\Lib\\importlib\\__init__.py", line 109, in import_module\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.201128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] return _bootstrap._gcd_import(name[level:], package, level)\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.201128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] File "<frozen importlib._bootstrap>", line 2254, in _gcd_import\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.201128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] File "<frozen importlib._bootstrap>", line 2237, in _find_and_load\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.201128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] File "<frozen importlib._bootstrap>", line 2212, in _find_and_load_unlocked\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.201128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.201128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] File "<frozen importlib._bootstrap>", line 2254, in _gcd_import\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.201128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] File "<frozen importlib._bootstrap>", line 2237, in _find_and_load\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.201128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] File "<frozen importlib._bootstrap>", line 2224, in _find_and_load_unlocked\r, referer: http://localhost:8090/calbase
[Thu Sep 29 18:18:27.201128 2016] [wsgi:error] [pid 10400:tid 1108] [client ::1:55760] ImportError: No module named 'equipcal'\r, referer: http://localhost:8090/calbase
Apparently it is calling problem with my wsgi.py inside of my project. Currently I am just using the default wsgi.py file created when startproject. So it is just this:
"""
WSGI config for equipcal project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "equipcal.settings")
application = get_wsgi_application()
And my current https.conf is like this:
# Change Python path used by the server.
WSGIPythonPath “/EquipmentCalibration”
# Make calls to http://localhost/ refer to the Python/WSGI-script located at the specified location.
WSGIScriptAlias / /EquipmentCalibration/equipcal/wsgi.py
# Make calls to http://localhost/static refer to the specified folder.
Alias /static/ /EquipmentCalibration/static
Alias /media/ /EquipmentCalibration/media
<Directory /EquipmentCalibration/static>
Require all granted
</Directory>
<Directory /EquipmentCalibration/media>
Require all granted
</Directory>
<Directory /EquipmentCalibration/equipcal>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
I tried to do a bit of research around but didn't seem to find how should I configure it. Could somebody please shed some light on this please?

Uninstalling django-haystack

I have an issue with haystack https://stackoverflow.com/q/33669864/4910881 that requires me to uninstall it for now. I commented out haystack from installed apps expecting it will start throwing django import errors or similar errors but it still returning an internal server error.
[Thu Nov 12 15:32:03.579793 2015] [wsgi:error] [pid 191252:tid 139675802625792] [remote 127.0.0.1:196] for conn in connections.all():
[Thu Nov 12 15:32:03.579802 2015] [wsgi:error] [pid 191252:tid 139675802625792] [remote 127.0.0.1:196] File "/home/kbuzz/lib/python2.7/haystack/utils/loading.py", line 112, in all
[Thu Nov 12 15:32:03.579815 2015] [wsgi:error] [pid 191252:tid 139675802625792] [remote 127.0.0.1:196] return [self[alias] for alias in self.connections_info]
[Thu Nov 12 15:32:03.579823 2015] [wsgi:error] [pid 191252:tid 139675802625792] [remote 127.0.0.1:196] File "/home/kbuzz/lib/python2.7/haystack/utils/loading.py", line 100, in __getitem__
[Thu Nov 12 15:32:03.579836 2015] [wsgi:error] [pid 191252:tid 139675802625792] [remote 127.0.0.1:196] self._connections[key] = load_backend(self.connections_info[key]['ENGINE'])(using=key)
[Thu Nov 12 15:32:03.579844 2015] [wsgi:error] [pid 191252:tid 139675802625792] [remote 127.0.0.1:196] File "/home/kbuzz/lib/python2.7/haystack/utils/loading.py", line 53, in load_backend
[Thu Nov 12 15:32:03.579857 2015] [wsgi:error] [pid 191252:tid 139675802625792] [remote 127.0.0.1:196] return import_class(full_backend_path)
[Thu Nov 12 15:32:03.579865 2015] [wsgi:error] [pid 191252:tid 139675802625792] [remote 127.0.0.1:196] File "/home/kbuzz/lib/python2.7/haystack/utils/loading.py", line 23, in import_class
[Thu Nov 12 15:32:03.579878 2015] [wsgi:error] [pid 191252:tid 139675802625792] [remote 127.0.0.1:196] raise ImportError("The Python module '%s' has no '%s' class." % (module_path, class_name))
[Thu Nov 12 15:32:03.579894 2015] [wsgi:error] [pid 191252:tid 139675802625792] [remote 127.0.0.1:196] ImportError: The Python module 'xapian_backend' has no 'XapianEngine' class.
[Thu Nov 12 15:32:03.626881 2015] [wsgi:error] [pid 191252:tid 139675918014208] [remote 127.0.0.1:11720] mod_wsgi (pid=191252): Exception occurred processing WSGI script '/home/kbuzz/webapps/revised/kb/kb/wsgi.py'.
[Thu Nov 12 15:32:03.626926 2015] [wsgi:error] [pid 191252:tid 139675918014208] [remote 127.0.0.1:11720] Traceback (most recent call last):
[Thu Nov 12 15:32:03.626950 2015] [wsgi:error] [pid 191252:tid 139675918014208] [remote 127.0.0.1:11720] File "/home/kbuzz/lib/python2.7/django/core/handlers/wsgi.py", line 175, in __call__
[Thu Nov 12 15:32:03.626989 2015] [wsgi:error] [pid 191252:tid 139675918014208] [remote 127.0.0.1:11720] signals.request_started.send(sender=self.__class__)
[Thu Nov 12 15:32:03.627014 2015] [wsgi:error] [pid 191252:tid 139675918014208] [remote 127.0.0.1:11720] File "/home/kbuzz/lib/python2.7/django/dispatch/dispatcher.py", line 198, in send
[Thu Nov 12 15:32:03.627041 2015] [wsgi:error] [pid 191252:tid 139675918014208] [remote 127.0.0.1:11720] response = receiver(signal=self, sender=sender, **named)
[Thu Nov 12 15:32:03.627057 2015] [wsgi:error] [pid 191252:tid 139675918014208] [remote 127.0.0.1:11720] File "/home/kbuzz/lib/python2.7/haystack/__init__.py", line 59, in reset_search_queries
[Thu Nov 12 15:32:03.627082 2015] [wsgi:error] [pid 191252:tid 139675918014208] [remote 127.0.0.1:11720] for conn in connections.all():
[Thu Nov 12 15:32:03.627097 2015] [wsgi:error] [pid 191252:tid 139675918014208] [remote 127.0.0.1:11720] File "/home/kbuzz/lib/python2.7/haystack/utils/loading.py", line 112, in all
[Thu Nov 12 15:32:03.627123 2015] [wsgi:error] [pid 191252:tid 139675918014208] [remote 127.0.0.1:11720] return [self[alias] for alias in self.connections_info]
[Thu Nov 12 15:32:03.627138 2015] [wsgi:error] [pid 191252:tid 139675918014208] [remote 127.0.0.1:11720] File "/home/kbuzz/lib/python2.7/haystack/utils/loading.py", line 100, in __getitem__
[Thu Nov 12 15:32:03.627161 2015] [wsgi:error] [pid 191252:tid 139675918014208] [remote 127.0.0.1:11720] self._connections[key] = load_backend(self.connections_info[key]['ENGINE'])(using=key)
[Thu Nov 12 15:32:03.627176 2015] [wsgi:error] [pid 191252:tid 139675918014208] [remote 127.0.0.1:11720] File "/home/kbuzz/lib/python2.7/haystack/utils/loading.py", line 53, in load_backend
[Thu Nov 12 15:32:03.627199 2015] [wsgi:error] [pid 191252:tid 139675918014208] [remote 127.0.0.1:11720] return import_class(full_backend_path)
[Thu Nov 12 15:32:03.627214 2015] [wsgi:error] [pid 191252:tid 139675918014208] [remote 127.0.0.1:11720] File "/home/kbuzz/lib/python2.7/haystack/utils/loading.py", line 23, in import_class
[Thu Nov 12 15:32:03.627237 2015] [wsgi:error] [pid 191252:tid 139675918014208] [remote 127.0.0.1:11720] raise ImportError("The Python module '%s' has no '%s' class." % (module_path, class_name))
[Thu Nov 12 15:32:03.627263 2015] [wsgi:error] [pid 191252:tid 139675918014208] [remote 127.0.0.1:11720] ImportError: The Python module 'xapian_backend' has no 'XapianEngine' class.
Try removing all related .pyc files