I am trying to deploy a django website. Project name is pom. I am trying to start django site on ec2 server using apache2 and get the following error:
Apache Error File:
[Fri Jul 24 12:37:33.621285 2015] [:info] [pid 20446:tid 140024755709824] mod_wsgi (pid=20446): Attach interpreter ''. [Fri Jul 24 12:37:33.621462 2015] [:info] [pid 20446:tid 140024755709824] mod_wsgi (pid=20446): Adding '/home/ubuntu/.virtualenvs/edusamosa/lib/python2.7/site-packages/' to path. [Fri Jul 24 12:37:44.145762 2015] [authz_core:debug] [pid 20448:tid 140024656201472] mod_authz_core.c(802): [client 49.248.57.164:11934] AH01626: authorization result of Require all granted: granted [Fri Jul 24 12:37:44.145888 2015] [authz_core:debug] [pid 20448:tid 140024656201472] mod_authz_core.c(802): [client 49.248.57.164:11934] AH01626: authorization result of <RequireAny>: granted [Fri Jul 24 12:37:44.145947 2015] [authz_core:debug] [pid 20448:tid 140024656201472] mod_authz_core.c(802): [client 49.248.57.164:11934] AH01626: authorization result of Require all granted: granted [Fri Jul 24 12:37:44.145953 2015] [authz_core:debug] [pid 20448:tid 140024656201472] mod_authz_core.c(802): [client 49.248.57.164:11934] AH01626: authorization result of <RequireAny>: granted [Fri Jul 24 12:37:44.152795 2015] [:info] [pid 20446:tid 140024564070144] mod_wsgi (pid=20446): Create interpreter 'www.edusamosa.in|'. [Fri Jul 24 12:37:44.153592 2015] [:info] [pid 20446:tid 140024564070144] mod_wsgi (pid=20446): Adding '/home/ubuntu/.virtualenvs/edusamosa/lib/python2.7/site-packages/' to path. [Fri Jul 24 12:37:44.152795 2015] [:info] [pid 20446:tid 140024564070144] mod_wsgi (pid=20446): Create interpreter 'www.edusamosa.in|'. [Fri Jul 24 12:37:44.153592 2015] [:info] [pid 20446:tid 140024564070144] mod_wsgi (pid=20446): Adding '/home/ubuntu/.virtualenvs/edusamosa/lib/python2.7/site-packages/' to path. [Fri Jul 24 12:37:44.153884 2015] [:info] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] mod_wsgi (pid=20446, process='pom', application='www.edusamosa.in|'): Loading WSGI script '/home/ubuntu/pom/pom/wsgi.py'. [Fri Jul 24 12:37:44.354165 2015] [:error] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] mod_wsgi (pid=20446): Target WSGI script '/home/ubuntu/pom/pom/wsgi.py' cannot be loaded as Python module. [Fri Jul 24 12:37:44.354189 2015] [:error] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] mod_wsgi (pid=20446): Exception occurred processing WSGI script '/home/ubuntu/pom/pom/wsgi.py'. [Fri Jul 24 12:37:44.354222 2015] [:error] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] Traceback (most recent call last): [Fri Jul 24 12:37:44.354238 2015] [:error] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] File "/home/ubuntu/pom/pom/wsgi.py", line 19, in <module> [Fri Jul 24 12:37:44.354362 2015] [:error] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] application = get_wsgi_application() @ [Fri Jul 24 12:37:44.354238 2015] [:error] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] File "/home/ubuntu/pom/pom/wsgi.py", line 19, in <module> [Fri Jul 24 12:37:44.354362 2015] [:error] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] application = get_wsgi_application() [Fri Jul 24 12:37:44.354377 2015] [:error] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] File "/usr/local/lib/python2.7/dist-packages/django/core/wsgi.py", line 14, in get_wsgi_application [Fri Jul 24 12:37:44.354416 2015] [:error] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] django.setup() [Fri Jul 24 12:37:44.354428 2015] [:error] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 18, in setup [Fri Jul 24 12:37:44.354465 2015] [:error] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] apps.populate(settings.INSTALLED_APPS) [Fri Jul 24 12:37:44.354476 2015] [:error] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 85, in populate [Fri Jul 24 12:37:44.354590 2015] [:error] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] app_config = AppConfig.create(entry) [Fri Jul 24 12:37:44.354602 2015] [:error] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 86, in create [Fri Jul 24 12:37:44.354590 2015] [:error] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] app_config = AppConfig.create(entry) [Fri Jul 24 12:37:44.354602 2015] [:error] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 86, in create [Fri Jul 24 12:37:44.354697 2015] [:error] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] module = import_module(entry) [Fri Jul 24 12:37:44.354708 2015] [:error] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module [Fri Jul 24 12:37:44.354765 2015] [:error] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] __import__(name) [Fri Jul 24 12:37:44.354793 2015] [:error] [pid 20446:tid 140024564070144] [remote 49.248.57.164:51213] ImportError: No module named allauth [Fri Jul 24 12:37:45.251341 2015] [authz_core:debug] [pid 20447:tid 140024656201472] mod_authz_core.c(802): [client 49.248.57.164:11938] AH01626: authorization result of Require all granted: granted, referer: http://edusamosa.in/ [Fri Jul 24 12:37:45.251496 2015] [authz_core:debug] [pid 20447:tid 140024656201472] mod_authz_core.c(802): [client 49.248.57.164:11938] AH01626: authorization result of <RequireAny>: granted, referer: http://edusamosa.in/ [Fri Jul 24 12:37:45.251559 2015] [authz_core:debug] [pid 20447:tid 140024656201472] mod_authz_core.c(802): [client 49.248.57.164:11938] AH01626: authorization result of Require all granted: granted, referer: http://edusamosa.in/ [Fri Jul 24 12:37:45.251496 2015] [authz_core:debug] [pid 20447:tid 140024656201472] mod_authz_core.c(802): [client 49.248.57.164:11938] AH01626: authorization result of <RequireAny>: granted, referer: http://edusamosa.in/ [Fri Jul 24 12:37:45.251559 2015] [authz_core:debug] [pid 20447:tid 140024656201472] mod_authz_core.c(802): [client 49.248.57.164:11938] AH01626: authorization result of Require all granted: granted, referer: http://edusamosa.in/ [Fri Jul 24 12:37:45.251565 2015] [authz_core:debug] [pid 20447:tid 140024656201472] mod_authz_core.c(802): [client 49.248.57.164:11938] AH01626: authorization result of <RequireAny>: granted, referer: http://edusamosa.in/ [Fri Jul 24 18:07:45.251722 2015] [:info] [pid 20446:tid 140024648070912] [remote 49.248.57.164:58879] mod_wsgi (pid=20446, process='pom', application='www.edusamosa.in|'): Loading WSGI script '/home/ubuntu/pom/pom/wsgi.py'. [Fri Jul 24 18:07:45.252817 2015] [:error] [pid 20446:tid 140024648070912] [remote 49.248.57.164:58879] mod_wsgi (pid=20446): Target WSGI script '/home/ubuntu/pom/pom/wsgi.py' cannot be loaded as Python module. [Fri Jul 24 18:07:45.252831 2015] [:error] [pid 20446:tid 140024648070912] [remote 49.248.57.164:58879] mod_wsgi (pid=20446): Exception occurred processing WSGI script '/home/ubuntu/pom/pom/wsgi.py'. [Fri Jul 24 18:07:45.252850 2015] [:error] [pid 20446:tid 140024648070912] [remote 49.248.57.164:58879] Traceback (most recent call last): [Fri Jul 24 18:07:45.252870 2015] [:error] [pid 20446:tid 140024648070912] [remote 49.248.57.164:58879] File "/home/ubuntu/pom/pom/wsgi.py", line 19, in <module> [Fri Jul 24 18:07:45.252850 2015] [:error] [pid 20446:tid 140024648070912] [remote 49.248.57.164:58879] Traceback (most recent call last): [Fri Jul 24 18:07:45.252870 2015] [:error] [pid 20446:tid 140024648070912] [remote 49.248.57.164:58879] File "/home/ubuntu/pom/pom/wsgi.py", line 19, in <module> [Fri Jul 24 18:07:45.252913 2015] [:error] [pid 20446:tid 140024648070912] [remote 49.248.57.164:58879] application = get_wsgi_application() [Fri Jul 24 18:07:45.252923 2015] [:error] [pid 20446:tid 140024648070912] [remote 49.248.57.164:58879] File "/usr/local/lib/python2.7/dist-packages/django/core/wsgi.py", line 14, in get_wsgi_application [Fri Jul 24 18:07:45.252940 2015] [:error] [pid 20446:tid 140024648070912] [remote 49.248.57.164:58879] django.setup() [Fri Jul 24 18:07:45.252948 2015] [:error] [pid 20446:tid 140024648070912] [remote 49.248.57.164:58879] File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 18, in setup [Fri Jul 24 18:07:45.252961 2015] [:error] [pid 20446:tid 140024648070912] [remote 49.248.57.164:58879] apps.populate(settings.INSTALLED_APPS) [Fri Jul 24 18:07:45.252969 2015] [:error] [pid 20446:tid 140024648070912] [remote 49.248.57.164:58879] File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 78, in populate [Fri Jul 24 18:07:45.252981 2015] [:error] [pid 20446:tid 140024648070912] [remote 49.248.57.164:58879] raise RuntimeError("populate() isn't reentrant") @ @ [Fri Jul 24 18:07:45.252969 2015] [:error] [pid 20446:tid 140024648070912] [remote 49.248.57.164:58879] File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 78, in populate [Fri Jul 24 18:07:45.252981 2015] [:error] [pid 20446:tid 140024648070912] [remote 49.248.57.164:58879] raise RuntimeError("populate() isn't reentrant") [Fri Jul 24 18:07:45.252996 2015] [:error] [pid 20446:tid 140024648070912] [remote 49.248.57.164:58879] RuntimeError: populate() isn't reentrant ~
My pom.settings.py looks like this:
""" Django settings for pom project. Generated by 'django-admin startproject' using Django 1.8.2. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """
The wsgi.py file is as follows:
""" WSGI config for pom 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.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application import sys from os.path import abspath, dirname, join