How to solve these errors ? Thank you very much for your help.
[Sat Apr 24 06:58:37.647922 2021] [:error] [pid 1430] [remote 172.31.12.184:248] mod_wsgi (pid=1430): Target WSGI script '/opt/python/current/app/greatkart/wsgi.py' cannot be loaded as Python module.
[Sat Apr 24 06:58:37.648302 2021] [:error] [pid 1430] [remote 172.31.12.184:248] File "/opt/python/current/app/greatkart/settings.py", line 120, in
[Sat Apr 24 06:58:37.648305 2021] [:error] [pid 1430] [remote 172.31.12.184:248] 'HOST': os.environ['RDS_HOSTNAME'],
wsgi.py
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'greatkart.settings')
application = get_wsgi_application()
settings.py
# Database Configuration
if 'RDS_DB_NAME' in os.environ:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.environ['RDS_DB_NAME'],
'USER': os.environ['RDS_USERNAME'],
'PASSWORD': os.environ['RDS_PASSWORD'],
'HOST': os.environ['RDS_HOSTNAME'],
'PORT': os.environ['RDS_PORT'],
}
}
requirements.txt
asgiref==3.2.10
certifi==2020.12.5
chardet==4.0.0
Django==3.1
django-admin-honeypot==1.1.0
django-admin-thumbnails==0.2.5
django-session-timeout==0.1.0
idna==2.10
Pillow==8.2.0
psycopg2-binary==2.8.6
python-decouple==3.4
pytz==2020.1
requests==2.25.1
six==1.15.0
sqlparse==0.3.1
urllib3==1.26.3
db-migrate.config
container_commands:
01_migrate:
command: "django-admin.py migrate"
leader_only: true
option_settings:
aws:elasticbeanstalk:application:environment:
DJANGO_SETTINGS_MODULE: greatkart.settings
django.config
option_settings:
"aws:elasticbeanstalk:container:python":
WSGIPath: "greatkart/wsgi.py"
"aws:elasticbeanstalk:container:python:staticfiles":
"/static/": "static/"
config.yml
branch-defaults:
main:
environment: django-env-4
group_suffix: null
environment-defaults:
django-env:
branch: null
repository: null
seast-kart-env:
branch: null
repository: null
global:
application_name: django-tutorial-4
branch: null
default_ec2_keyname: aws-eb
default_platform: Python 3.6
default_region: us-west-2
include_git_submodules: true
instance_profile: null
platform_name: null
platform_version: null
profile: eb-cli
repository: null
sc: git
workspace_type: Application
Edit :
Full Traceback
[Fri Apr 23 13:21:43.405667 2021] [suexec:notice] [pid 3188] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Apr 23 13:21:43.420808 2021] [http2:warn] [pid 3188] 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.
[Fri Apr 23 13:21:43.420820 2021] [http2:warn] [pid 3188] AH02951: mod_ssl does not seem to be enabled
[Fri Apr 23 13:21:43.421241 2021] [lbmethod_heartbeat:notice] [pid 3188] AH02282: No slotmem from mod_heartmonitor
[Fri Apr 23 13:21:43.421281 2021] [:warn] [pid 3188] mod_wsgi: Compiled for Python/3.6.2.
[Fri Apr 23 13:21:43.421285 2021] [:warn] [pid 3188] mod_wsgi: Runtime using Python/3.6.12.
[Fri Apr 23 13:21:43.423065 2021] [mpm_prefork:notice] [pid 3188] AH00163: Apache/2.4.46 (Amazon) mod_wsgi/3.5 Python/3.6.12 configured -- resuming normal operations
[Fri Apr 23 13:21:43.423081 2021] [core:notice] [pid 3188] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Fri Apr 23 13:22:18.244515 2021] [mpm_prefork:notice] [pid 3188] AH00169: caught SIGTERM, shutting down
[Fri Apr 23 13:22:19.296214 2021] [suexec:notice] [pid 3418] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Apr 23 13:22:19.310192 2021] [so:warn] [pid 3418] AH01574: module wsgi_module is already loaded, skipping
[Fri Apr 23 13:22:19.312609 2021] [http2:warn] [pid 3418] 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.
[Fri Apr 23 13:22:19.312621 2021] [http2:warn] [pid 3418] AH02951: mod_ssl does not seem to be enabled
[Fri Apr 23 13:22:19.313166 2021] [lbmethod_heartbeat:notice] [pid 3418] AH02282: No slotmem from mod_heartmonitor
[Fri Apr 23 13:22:19.313227 2021] [:warn] [pid 3418] mod_wsgi: Compiled for Python/3.6.2.
[Fri Apr 23 13:22:19.313232 2021] [:warn] [pid 3418] mod_wsgi: Runtime using Python/3.6.12.
[Fri Apr 23 13:22:19.315504 2021] [mpm_prefork:notice] [pid 3418] AH00163: Apache/2.4.46 (Amazon) mod_wsgi/3.5 Python/3.6.12 configured -- resuming normal operations
[Fri Apr 23 13:22:19.315522 2021] [core:notice] [pid 3418] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Fri Apr 23 13:22:22.687415 2021] [:error] [pid 3423] [remote 127.0.0.1:0] mod_wsgi (pid=3423): Target WSGI script '/opt/python/current/app/greatkart/wsgi.py' cannot be loaded as Python module.
[Fri Apr 23 13:22:22.687467 2021] [:error] [pid 3423] [remote 127.0.0.1:0] mod_wsgi (pid=3423): Exception occurred processing WSGI script '/opt/python/current/app/greatkart/wsgi.py'.
[Fri Apr 23 13:22:22.688631 2021] [:error] [pid 3423] [remote 127.0.0.1:0] Traceback (most recent call last):
[Fri Apr 23 13:22:22.688694 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "/opt/python/current/app/greatkart/wsgi.py", line 16, in <module>
[Fri Apr 23 13:22:22.688699 2021] [:error] [pid 3423] [remote 127.0.0.1:0] application = get_wsgi_application()
[Fri Apr 23 13:22:22.688706 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Fri Apr 23 13:22:22.688710 2021] [:error] [pid 3423] [remote 127.0.0.1:0] django.setup(set_prefix=False)
[Fri Apr 23 13:22:22.688715 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/__init__.py", line 19, in setup
[Fri Apr 23 13:22:22.688719 2021] [:error] [pid 3423] [remote 127.0.0.1:0] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[Fri Apr 23 13:22:22.688725 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/conf/__init__.py", line 83, in __getattr__
[Fri Apr 23 13:22:22.688733 2021] [:error] [pid 3423] [remote 127.0.0.1:0] self._setup(name)
[Fri Apr 23 13:22:22.688740 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/conf/__init__.py", line 70, in _setup
[Fri Apr 23 13:22:22.688743 2021] [:error] [pid 3423] [remote 127.0.0.1:0] self._wrapped = Settings(settings_module)
[Fri Apr 23 13:22:22.688748 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/conf/__init__.py", line 177, in __init__
[Fri Apr 23 13:22:22.688752 2021] [:error] [pid 3423] [remote 127.0.0.1:0] mod = importlib.import_module(self.SETTINGS_MODULE)
[Fri Apr 23 13:22:22.688757 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "/opt/python/run/venv/lib64/python3.6/importlib/__init__.py", line 126, in import_module
[Fri Apr 23 13:22:22.688760 2021] [:error] [pid 3423] [remote 127.0.0.1:0] return _bootstrap._gcd_import(name[level:], package, level)
[Fri Apr 23 13:22:22.688765 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Fri Apr 23 13:22:22.688770 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Fri Apr 23 13:22:22.688775 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
[Fri Apr 23 13:22:22.688781 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
[Fri Apr 23 13:22:22.688786 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap_external>", line 674, in exec_module
[Fri Apr 23 13:22:22.688791 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap_external>", line 781, in get_code
[Fri Apr 23 13:22:22.688796 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap_external>", line 741, in source_to_code
[Fri Apr 23 13:22:22.688801 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[Fri Apr 23 13:22:22.688815 2021] [:error] [pid 3423] [remote 127.0.0.1:0] File "/opt/python/current/app/greatkart/settings.py", line 33
[Fri Apr 23 13:22:22.688824 2021] [:error] [pid 3423] [remote 127.0.0.1:0] \xc2\xb2
[Fri Apr 23 13:22:22.688838 2021] [:error] [pid 3423] [remote 127.0.0.1:0] ^
[Fri Apr 23 13:22:22.688845 2021] [:error] [pid 3423] [remote 127.0.0.1:0] SyntaxError: invalid character in identifier
[Fri Apr 23 13:22:23.691877 2021] [:error] [pid 3423] [remote 127.0.0.1:40] mod_wsgi (pid=3423): Target WSGI script '/opt/python/current/app/greatkart/wsgi.py' cannot be loaded as Python module.
[Fri Apr 23 13:22:23.691926 2021] [:error] [pid 3423] [remote 127.0.0.1:40] mod_wsgi (pid=3423): Exception occurred processing WSGI script '/opt/python/current/app/greatkart/wsgi.py'.
[Fri Apr 23 13:22:23.692096 2021] [:error] [pid 3423] [remote 127.0.0.1:40] Traceback (most recent call last):
[Fri Apr 23 13:22:23.692152 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "/opt/python/current/app/greatkart/wsgi.py", line 16, in <module>
[Fri Apr 23 13:22:23.692157 2021] [:error] [pid 3423] [remote 127.0.0.1:40] application = get_wsgi_application()
[Fri Apr 23 13:22:23.692163 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Fri Apr 23 13:22:23.692167 2021] [:error] [pid 3423] [remote 127.0.0.1:40] django.setup(set_prefix=False)
[Fri Apr 23 13:22:23.692172 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/__init__.py", line 19, in setup
[Fri Apr 23 13:22:23.692176 2021] [:error] [pid 3423] [remote 127.0.0.1:40] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[Fri Apr 23 13:22:23.692181 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/conf/__init__.py", line 83, in __getattr__
[Fri Apr 23 13:22:23.692193 2021] [:error] [pid 3423] [remote 127.0.0.1:40] self._setup(name)
[Fri Apr 23 13:22:23.692199 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/conf/__init__.py", line 70, in _setup
[Fri Apr 23 13:22:23.692202 2021] [:error] [pid 3423] [remote 127.0.0.1:40] self._wrapped = Settings(settings_module)
[Fri Apr 23 13:22:23.692207 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/conf/__init__.py", line 177, in __init__
[Fri Apr 23 13:22:23.692211 2021] [:error] [pid 3423] [remote 127.0.0.1:40] mod = importlib.import_module(self.SETTINGS_MODULE)
[Fri Apr 23 13:22:23.692216 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "/opt/python/run/venv/lib64/python3.6/importlib/__init__.py", line 126, in import_module
[Fri Apr 23 13:22:23.692219 2021] [:error] [pid 3423] [remote 127.0.0.1:40] return _bootstrap._gcd_import(name[level:], package, level)
[Fri Apr 23 13:22:23.692224 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Fri Apr 23 13:22:23.692229 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Fri Apr 23 13:22:23.692234 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
[Fri Apr 23 13:22:23.692239 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
[Fri Apr 23 13:22:23.692244 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "<frozen importlib._bootstrap_external>", line 674, in exec_module
[Fri Apr 23 13:22:23.692249 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "<frozen importlib._bootstrap_external>", line 781, in get_code
[Fri Apr 23 13:22:23.692259 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "<frozen importlib._bootstrap_external>", line 741, in source_to_code
[Fri Apr 23 13:22:23.692264 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[Fri Apr 23 13:22:23.692278 2021] [:error] [pid 3423] [remote 127.0.0.1:40] File "/opt/python/current/app/greatkart/settings.py", line 33
[Fri Apr 23 13:22:23.692288 2021] [:error] [pid 3423] [remote 127.0.0.1:40] \xc2\xb2
[Fri Apr 23 13:22:23.692304 2021] [:error] [pid 3423] [remote 127.0.0.1:40] ^
[Fri Apr 23 13:22:23.692311 2021] [:error] [pid 3423] [remote 127.0.0.1:40] SyntaxError: invalid character in identifier
[Fri Apr 23 13:22:24.695493 2021] [:error] [pid 3423] [remote 127.0.0.1:40] mod_wsgi (pid=3423): Target WSGI script '/opt/python/current/app/greatkart/wsgi.py' cannot be loaded as Python module.
Edit 2
Database config :
Database config in AWS EB
Related
I want to serve my project using mod_wsgi. When i run development server, It's started but it gives error on production server.My os is RedHat and using httpd(apache) virtual host configured with python3-mod_wsgi.
This is my error
[Tue Oct 05 14:01:48.998236 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] mod_wsgi (pid=423542): Failed to exec Python script file '/var/www/public_html/main/main/wsgi.py'.
[Tue Oct 05 14:01:48.998291 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] mod_wsgi (pid=423542): Exception occurred processing WSGI script '/var/www/public_html/main/main/wsgi.py'.
[Tue Oct 05 14:01:48.998461 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] Traceback (most recent call last):
[Tue Oct 05 14:01:48.998506 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] File "/var/www/public_html/main/main/wsgi.py", line 17, in <module>
[Tue Oct 05 14:01:48.998523 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] application = get_wsgi_application()
[Tue Oct 05 14:01:48.998530 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] File "/usr/local/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Tue Oct 05 14:01:48.998534 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] django.setup(set_prefix=False)
[Tue Oct 05 14:01:48.998540 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] File "/usr/local/lib/python3.6/site-packages/django/__init__.py", line 19, in setup
[Tue Oct 05 14:01:48.998543 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[Tue Oct 05 14:01:48.998548 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] File "/usr/local/lib/python3.6/site-packages/django/conf/__init__.py", line 76, in __getattr__
[Tue Oct 05 14:01:48.998552 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] self._setup(name)
[Tue Oct 05 14:01:48.998557 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] File "/usr/local/lib/python3.6/site-packages/django/conf/__init__.py", line 63, in _setup
[Tue Oct 05 14:01:48.998560 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] self._wrapped = Settings(settings_module)
[Tue Oct 05 14:01:48.998565 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] File "/usr/local/lib/python3.6/site-packages/django/conf/__init__.py", line 142, in __init__
[Tue Oct 05 14:01:48.998569 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] mod = importlib.import_module(self.SETTINGS_MODULE)
[Tue Oct 05 14:01:48.998574 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module
[Tue Oct 05 14:01:48.998577 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] return _bootstrap._gcd_import(name[level:], package, level)
[Tue Oct 05 14:01:48.998582 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Tue Oct 05 14:01:48.998587 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Tue Oct 05 14:01:48.998592 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
[Tue Oct 05 14:01:48.998597 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[Tue Oct 05 14:01:48.998602 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Tue Oct 05 14:01:48.998614 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Tue Oct 05 14:01:48.998619 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
[Tue Oct 05 14:01:48.998633 2021] [wsgi:error] [pid 423542:tid 140143400638208] [remote 209.141.62.185:36776] ModuleNotFoundError: No module named 'main'
This is my project wsgi.py file
import os
import sys
#from django.conf import settings
from django.core.wsgi import get_wsgi_application
#sys.path.append('/var/www/public_html/main/')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'main.settings')
application = get_wsgi_application()
I Changed my wsgi.py file to this now it's working
"""
WSGI config for main 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/3.0/howto/deployment/wsgi/
"""
import os
import sys
from django.core.wsgi import get_wsgi_application
sys.path.append('/var/www/public_html/')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'main.settings')
application = get_wsgi_application()
I am trying for two days to deploy my django project on aws. But i am getting one error after another.
After lots of searching for answers. This is the last error that i am not able to overcome.
I am following these guides:
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html
https://www.1strategy.com/blog/2017/05/23/tutorial-django-elastic-beanstalk/
After all of it.
When i try to access my site.It shows 500 Server Error.
In Logs it Shows
Target WSGI script '/opt/python/current/app/github/wsgi.py' cannot be loaded as Python module.
Another question on net answered to comment the Database lines in settings file.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
This is my wsgi.py file
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')
application = get_wsgi_application()
After it my site loads. But then the problem is there is not database. So it throws another error
settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.
So now i am struck here. I have looked at every related question tried there solution but nothing is working. It is my first time trying AWS and it is turning out to be very hard. I deployed my project on heroku successfully but heroku does not support cron job and i really need something like cron job for my project.
This is my django.config in .ebextensions folder
option_settings:
"aws:elasticbeanstalk:application:environment":
DJANGO_SETTINGS_MODULE: "github.settings"
PYTHONPATH: "$PYTHONPATH"
"aws:elasticbeanstalk:container:python":
WSGIPath: "github/wsgi.py"
StaticFiles: "/static/=www/static/"
packages:
yum:
postgresql95-devel: []
After changing to WSGIPath: github.wsgi:application
The error stays the same as 500 internal error
but error in log changes so.
[Fri Sep 18 19:50:46.625700 2020] [:error] [pid 6504] [remote 127.0.0.1:0] application = get_wsgi_application()
[Fri Sep 18 19:50:46.625707 2020] [:error] [pid 6504] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Fri Sep 18 19:50:46.625711 2020] [:error] [pid 6504] [remote 127.0.0.1:0] django.setup(set_prefix=False)
[Fri Sep 18 19:50:46.625721 2020] [:error] [pid 6504] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
[Fri Sep 18 19:50:46.625725 2020] [:error] [pid 6504] [remote 127.0.0.1:0] apps.populate(settings.INSTALLED_APPS)
[Fri Sep 18 19:50:46.625730 2020] [:error] [pid 6504] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/apps/registry.py", line 114, in populate
[Fri Sep 18 19:50:46.625734 2020] [:error] [pid 6504] [remote 127.0.0.1:0] app_config.import_models()
[Fri Sep 18 19:50:46.625740 2020] [:error] [pid 6504] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/apps/config.py", line 211, in import_models
[Fri Sep 18 19:50:46.625743 2020] [:error] [pid 6504] [remote 127.0.0.1:0] self.models_module = import_module(models_module_name)
[Fri Sep 18 19:50:46.625749 2020] [:error] [pid 6504] [remote 127.0.0.1:0] File "/opt/python/run/venv/lib64/python3.6/importlib/__init__.py", line 126, in import_module
[Fri Sep 18 19:50:46.625753 2020] [:error] [pid 6504] [remote 127.0.0.1:0] return _bootstrap._gcd_import(name[level:], package, level)
[Fri Sep 18 19:50:46.625758 2020] [:error] [pid 6504] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[Fri Sep 18 19:50:46.625776 2020] [:error] [pid 6504] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Fri Sep 18 19:50:46.625782 2020] [:error] [pid 6504] [remote 127.0.0.1:0] File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
665, in _load_unlocked
[Fri Sep 18 19:50:46.625816 2020] [:error] [pid 6504] [remote 127.0.0.1:0] class AbstractBaseUser(models.Model):
[Fri Sep 18 19:50:46.625832 2020] [:error] [pid 6504] [remote 127.0.0.1:0] value.contribute_to_class(cls, name)
[Fri Sep 18 19:50:46.625838 2020] [:error] [pid 6504] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/models/options.py", line 206, in contribute_to_class-- More --[Fri Sep 18 19:50:46.625859 2020] [:error] [pid 6504] [remote 127.0.0.1:0] backend = load_backend(db['ENGINE'])
[Fri Sep 18 19:50:46.625884 2020] [:error] [pid 6504] [remote 127.0.0.1:0] check_sqlite_version()
[Fri Sep 18 19:50:46.625889 2020] [:error] [pid 6504] [remote 127.0.0.1:0] File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 67, in check_sqlite_version-- M[Fri Sep 18 19:50:47.629796 2020] [:error] [pid 6504] [remote 127.0.0.1:28] Traceback (most recent call last):
[Fri Sep 18 19:50:47.629840 2020] [:error] [pid 6504] [remote 127.0.0.1:28] application = get_wsgi_application()
[Fri Sep 18 19:50:47.629850 2020] [:error] [pid 6504] [remote 127.0.0.1:28] django.setup(set_prefix=False)
[Fri Sep 18 19:50:47.629860 2020] [:error] [pid 6504] [remote 127.0.0.1:28] apps.populate(settings.INSTALLED_APPS)
[Fri Sep 18 19:50:47.629884 2020] [:error] [pid 6504] [remote 127.0.0.1:28] RuntimeError: populate() isn't reentrant
[Fri Sep 18 19:50:48.633315 2020] [:error] [pid 6504] [remote 127.0.0.1:28] Traceback (most recent call last):
[Fri Sep 18 19:50:48.633351 2020] [:error] [pid 6504] [remote 127.0.0.1:28] application = get_wsgi_application()
[Fri Sep 18 19:50:48.633362 2020] [:error] [pid 6504] [remote 127.0.0.1:28] django.setup(set_prefix=False)
[Fri Sep 18 19:50:48.633372 2020] [:error] [pid 6504] [remote 127.0.0.1:28] apps.populate(settings.INSTALLED_APPS)
[Fri Sep 18 19:50:48.633396 2020] [:error] [pid 6504] [remote 127.0.0.1:28] RuntimeError: populate() isn't reentrant
[Fri Sep 18 19:50:49.638585 2020] [:error] [pid 6504] [remote 127.0.0.1:32] Traceback (most recent call last):
[Fri Sep 18 19:50:49.638628 2020] [:error] [pid 6504] [remote 127.0.0.1:32] application = get_wsgi_application()
[Fri Sep 18 19:50:49.638638 2020] [:error] [pid 6504] [remote 127.0.0.1:32] django.setup(set_prefix=False)
[Fri Sep 18 19:50:49.638647 2020] [:error] [pid 6504] [remote 127.0.0.1:32] apps.populate(settings.INSTALLED_APPS)
[Fri Sep 18 19:50:49.638672 2020] [:error] [pid 6504] [remote 127.0.0.1:32] RuntimeError: populate() isn't reentrant
[Fri Sep 18 19:51:21.223059 2020] [:error] [pid 6504] [remote 172.31.2.91:32] Traceback (most recent call last):
[Fri Sep 18 19:51:21.223107 2020] [:error] [pid 6504] [remote 172.31.2.91:32] application = get_wsgi_application()
[Fri Sep 18 19:51:21.223118 2020] [:error] [pid 6504] [remote 172.31.2.91:32] django.setup(set_prefix=False)
[Fri Sep 18 19:51:21.223154 2020] [:error] [pid 6504] [remote 172.31.2.91:32] RuntimeError: populate() isn't reentrant
[Fri Sep 18 19:51:22.482909 2020] [:error] [pid 6504] [remote 172.31.2.91:32] Traceback (most recent call last):
[Fri Sep 18 19:51:22.482955 2020] [:error] [pid 6504] [remote 172.31.2.91:32] application = get_wsgi_application()
[Fri Sep 18 19:51:22.482966 2020] [:error] [pid 6504] [remote 172.31.2.91:32] django.setup(set_prefix=False)
[Fri Sep 18 19:51:22.483001 2020] [:error] [pid 6504] [remote 172.31.2.91:32] RuntimeError: populate() isn't reentrant
I have an Django application using RDS Postgres on AWS Beanstalk. The Beanstalk environment does not use the default RDS setup. I have a separate RDS instance of Postgres running.
In my settings file I have the below for my database dictionary:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.environ['RDS_DB_NAME'],
'USER': os.environ['RDS_USERNAME'],
'PASSWORD': os.environ['RDS_PASSWORD'],
'HOST': os.environ['RDS_HOSTNAME'],
'PORT': os.environ['RDS_PORT'],
}
}
When I visit the environment's URL I get a 500 error. Below are the error_logs for one visit.
[Sun Dec 23 18:43:24.116897 2018] [:error] [pid 1881] [remote 172.31.30.131:0] mod_wsgi (pid=1881): Target WSGI script '/opt/python/current/app/my_app/wsgi.py' cannot be loaded as Python module.
[Sun Dec 23 18:43:24.117094 2018] [:error] [pid 1881] [remote 172.31.30.131:0] mod_wsgi (pid=1881): Exception occurred processing WSGI script '/opt/python/current/app/my_app/wsgi.py'.
[Sun Dec 23 18:43:24.117230 2018] [:error] [pid 1881] [remote 172.31.30.131:0] Traceback (most recent call last):
[Sun Dec 23 18:43:24.117313 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/current/app/my_app/wsgi.py", line 16, in <module>
[Sun Dec 23 18:43:24.117458 2018] [:error] [pid 1881] [remote 172.31.30.131:0] application = get_wsgi_application()
[Sun Dec 23 18:43:24.117553 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Sun Dec 23 18:43:24.117668 2018] [:error] [pid 1881] [remote 172.31.30.131:0] django.setup(set_prefix=False)
[Sun Dec 23 18:43:24.117757 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
[Sun Dec 23 18:43:24.117899 2018] [:error] [pid 1881] [remote 172.31.30.131:0] apps.populate(settings.INSTALLED_APPS)
[Sun Dec 23 18:43:24.117971 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
[Sun Dec 23 18:43:24.118183 2018] [:error] [pid 1881] [remote 172.31.30.131:0] app_config.import_models()
[Sun Dec 23 18:43:24.118266 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models
[Sun Dec 23 18:43:24.118444 2018] [:error] [pid 1881] [remote 172.31.30.131:0] self.models_module = import_module(models_module_name)
[Sun Dec 23 18:43:24.118511 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
[Sun Dec 23 18:43:24.118625 2018] [:error] [pid 1881] [remote 172.31.30.131:0] __import__(name)
[Sun Dec 23 18:43:24.118687 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/contrib/auth/models.py", line 4, in <module>
[Sun Dec 23 18:43:24.118874 2018] [:error] [pid 1881] [remote 172.31.30.131:0] from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
[Sun Dec 23 18:43:24.118956 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/contrib/auth/base_user.py", line 52, in <module>
[Sun Dec 23 18:43:24.119098 2018] [:error] [pid 1881] [remote 172.31.30.131:0] class AbstractBaseUser(models.Model):
[Sun Dec 23 18:43:24.119159 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/db/models/base.py", line 124, in __new__
[Sun Dec 23 18:43:24.120069 2018] [:error] [pid 1881] [remote 172.31.30.131:0] new_class.add_to_class('_meta', Options(meta, app_label))
[Sun Dec 23 18:43:24.120155 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/db/models/base.py", line 325, in add_to_class
[Sun Dec 23 18:43:24.120229 2018] [:error] [pid 1881] [remote 172.31.30.131:0] value.contribute_to_class(cls, name)
[Sun Dec 23 18:43:24.120306 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/db/models/options.py", line 214, in contribute_to_class
[Sun Dec 23 18:43:24.120597 2018] [:error] [pid 1881] [remote 172.31.30.131:0] self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
[Sun Dec 23 18:43:24.120827 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/db/__init__.py", line 33, in __getattr__
[Sun Dec 23 18:43:24.120943 2018] [:error] [pid 1881] [remote 172.31.30.131:0] return getattr(connections[DEFAULT_DB_ALIAS], item)
[Sun Dec 23 18:43:24.121023 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/db/utils.py", line 211, in __getitem__
[Sun Dec 23 18:43:24.121191 2018] [:error] [pid 1881] [remote 172.31.30.131:0] backend = load_backend(db['ENGINE'])
[Sun Dec 23 18:43:24.121260 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/db/utils.py", line 115, in load_backend
[Sun Dec 23 18:43:24.121347 2018] [:error] [pid 1881] [remote 172.31.30.131:0] return import_module('%s.base' % backend_name)
[Sun Dec 23 18:43:24.121415 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
[Sun Dec 23 18:43:24.121495 2018] [:error] [pid 1881] [remote 172.31.30.131:0] __import__(name)
[Sun Dec 23 18:43:24.121550 2018] [:error] [pid 1881] [remote 172.31.30.131:0] File "/opt/python/run/venv/lib/python2.7/site-packages/django/db/backends/postgresql/base.py", line 25, in <module>
[Sun Dec 23 18:43:24.121728 2018] [:error] [pid 1881] [remote 172.31.30.131:0] raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
[Sun Dec 23 18:43:24.121799 2018] [:error] [pid 1881] [remote 172.31.30.131:0] ImproperlyConfigured: Error loading psycopg2 module: No module named psycopg2
If I comment out my Database dictionary and visit a view that does not query the Database I get a 200 and the content as expected. If I then uncomment the Database dictionary I get a 500 no matter what view I visit.
In my requirements.txt I have Django==1.11.17 and psycopg2==2.7.5. I can see from the eb-activity.log where these are being successfully installed by PIP when the environment is created or updated.
I'm really at a loss as to what the issue could be at this point.
In the end this ended up being a Python Path issue. The solution surfaced in this comment from an article on setting up Django on EB: https://realpython.com/deploying-a-django-app-and-postgresql-to-aws-elastic-beanstalk/#comment-2849390172
I am struggling trying to get Apache 2.4.7 to serve a Django 1.8.17 application using mod_wsgi 4.5.15 with Python 3.5.3 as a virtual environment. This is the only virtual environment I have on the machine (Linux Mint 17.3).
I am getting an "internal Server Error" in the browser.
My Apache error log says:
[Thu Apr 06 19:48:22.530935 2017] [mpm_prefork:notice] [pid 4476] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.21 mod_wsgi/4.5.15 Python/3.5 configured -- resuming normal operations
[Thu Apr 06 19:48:22.531008 2017] [core:notice] [pid 4476] AH00094: Command line: '/usr/sbin/apache2'
[Thu Apr 06 19:48:28.165360 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] mod_wsgi (pid=4480): Target WSGI script '/home/magic-rat/ektropy_project/ektropy_project/wsgi.py' cannot be loaded as Python module.
[Thu Apr 06 19:48:28.165494 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] mod_wsgi (pid=4480): Exception occurred processing WSGI script '/home/magic-rat/ektropy_project/ektropy_project/wsgi.py'.
[Thu Apr 06 19:48:28.166150 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] Traceback (most recent call last):
[Thu Apr 06 19:48:28.166210 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] File "/home/magic-rat/ektropy_project/ektropy_project/wsgi.py", line 16, in <module>
[Thu Apr 06 19:48:28.166218 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] application = get_wsgi_application()
[Thu Apr 06 19:48:28.166230 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] File "/home/magic-rat/virtualenvs/ektropy_project/lib/python3.5/site-packages/django/core/wsgi.py", line 14, in get_wsgi_application
[Thu Apr 06 19:48:28.166238 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] django.setup()
[Thu Apr 06 19:48:28.166250 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] File "/home/magic-rat/virtualenvs/ektropy_project/lib/python3.5/site-packages/django/__init__.py", line 17, in setup
[Thu Apr 06 19:48:28.166257 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[Thu Apr 06 19:48:28.166269 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] File "/home/magic-rat/virtualenvs/ektropy_project/lib/python3.5/site-packages/django/conf/__init__.py", line 48, in __getattr__
[Thu Apr 06 19:48:28.166276 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] self._setup(name)
[Thu Apr 06 19:48:28.166288 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] File "/home/magic-rat/virtualenvs/ektropy_project/lib/python3.5/site-packages/django/conf/__init__.py", line 44, in _setup
[Thu Apr 06 19:48:28.166295 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] self._wrapped = Settings(settings_module)
[Thu Apr 06 19:48:28.166307 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] File "/home/magic-rat/virtualenvs/ektropy_project/lib/python3.5/site-packages/django/conf/__init__.py", line 92, in __init__
[Thu Apr 06 19:48:28.166314 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] mod = importlib.import_module(self.SETTINGS_MODULE)
[Thu Apr 06 19:48:28.166325 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] File "/usr/local/lib/python3.5/importlib/__init__.py", line 126, in import_module
[Thu Apr 06 19:48:28.166335 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] return _bootstrap._gcd_import(name[level:], package, level)
[Thu Apr 06 19:48:28.166347 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] File "<frozen importlib._bootstrap>", line 986, in _gcd_import
[Thu Apr 06 19:48:28.166358 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] File "<frozen importlib._bootstrap>", line 969, in _find_and_load
[Thu Apr 06 19:48:28.166369 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] File "<frozen importlib._bootstrap>", line 944, in _find_and_load_unlocked
[Thu Apr 06 19:48:28.166381 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
[Thu Apr 06 19:48:28.166392 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] File "<frozen importlib._bootstrap>", line 986, in _gcd_import
[Thu Apr 06 19:48:28.166418 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] File "<frozen importlib._bootstrap>", line 969, in _find_and_load
[Thu Apr 06 19:48:28.166429 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
[Thu Apr 06 19:48:28.166464 2017] [wsgi:error] [pid 4480] [remote 127.0.0.1:34901] ImportError: No module named 'ektropy_project'
My directory structure is:
home/magic-rat/
|
|__________virtualenvs
| |
| |-ektropy_project
| |
| |-lib
| |
| |-python3.5
| |
| |-site_packages
|
|__________ektropy_project
|
|-manage.py
|
|-ektropy_project
|
|-wsgi.py
|-helloworld.wsgi (so you can see where it is)
My Apache Virtual host file is:
<VirtualHost *:8000>
ServerAdmin webmaster#localhost
DocumentRoot /var/www/html
WSGIDaemonProcess ektropy_project python-home=/home/magic-rat/virtualenvs/ektropy_project
WSGIProcessGroup ektropy_project
WSGIApplicationGroup %{GLOBAL}
WSGIScriptAlias / /home/magic-rat/ektropy_project/ektropy_project/wsgi.py
<Directory /home/magic-rat/ektropy_project/ektropy_project>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
My wsgi.py file is:
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ektropy_project.settings")
application = get_wsgi_application()
I believe mod_wsgi is configured properly. I can run a simple hello_world program and it works.
I believe permissions are set properly on all the files.
Any help is appreciated.
Add an extra option to WSGIDaemonProcess of:
python-path=/home/magic-rat/ektropy_project
You have to tell mod_wsgi where your project code is as well so it can import it.
This is my first release of a new Django app on my production server. Locally it works perfectly but on my production server I get the following 500 Internal Error. I can't figure out what sysmon referees too.
from my log file:
[Thu Jun 25 06:49:11.415601 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] mod_wsgi (pid=6066): Target WSGI script '/home/ymorin007/webapps/hoozdis_com/src/hoozdis/wsgi.py' cannot be loaded as Python module.
[Thu Jun 25 06:49:11.415680 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] mod_wsgi (pid=6066): Exception occurred processing WSGI script '/home/ymorin007/webapps/hoozdis_com/src/hoozdis/wsgi.py'.
[Thu Jun 25 06:49:11.415717 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] Traceback (most recent call last):
[Thu Jun 25 06:49:11.415869 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] File "/home/ymorin007/webapps/hoozdis_com/src/hoozdis/wsgi.py", line 31, in <module>
[Thu Jun 25 06:49:11.415883 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] application = get_wsgi_application()
[Thu Jun 25 06:49:11.415971 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] File "/home/ymorin007/webapps/hoozdis_com/lib/python3.4/Django-1.8.2-py3.4.egg/django/core/wsgi.py", line 14, in get_wsgi_application
[Thu Jun 25 06:49:11.415978 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] django.setup()
[Thu Jun 25 06:49:11.416060 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] File "/home/ymorin007/webapps/hoozdis_com/lib/python3.4/Django-1.8.2-py3.4.egg/django/__init__.py", line 18, in setup
[Thu Jun 25 06:49:11.416067 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] apps.populate(settings.INSTALLED_APPS)
[Thu Jun 25 06:49:11.416220 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] File "/home/ymorin007/webapps/hoozdis_com/lib/python3.4/Django-1.8.2-py3.4.egg/django/apps/registry.py", line 85, in populate
[Thu Jun 25 06:49:11.416227 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] app_config = AppConfig.create(entry)
[Thu Jun 25 06:49:11.416341 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] File "/home/ymorin007/webapps/hoozdis_com/lib/python3.4/Django-1.8.2-py3.4.egg/django/apps/config.py", line 86, in create
[Thu Jun 25 06:49:11.416348 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] module = import_module(entry)
[Thu Jun 25 06:49:11.416455 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] File "/usr/local/lib/python3.4/importlib/__init__.py", line 109, in import_module
[Thu Jun 25 06:49:11.416462 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] return _bootstrap._gcd_import(name[level:], package, level)
[Thu Jun 25 06:49:11.416479 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
[Thu Jun 25 06:49:11.416494 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
[Thu Jun 25 06:49:11.416508 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] File "<frozen importlib._bootstrap>", line 2224, in _find_and_load_unlocked
[Thu Jun 25 06:49:11.416615 2015] [wsgi:error] [pid 6066:tid 140229352871680] [remote 127.0.0.1:52480] ImportError: No module named 'sysmon'
And also I've just notice that when restart the server I get the following error (RuntimeError: populate() isn't reentrant
):
[Thu Jun 25 08:01:43.556475 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] mod_wsgi (pid=6066): Target WSGI script '/home/ymorin007/webapps/hoozdis_com/src/hoozdis/wsgi.py' cannot be loaded as Python module.
[Thu Jun 25 08:01:43.556561 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] mod_wsgi (pid=6066): Exception occurred processing WSGI script '/home/ymorin007/webapps/hoozdis_com/src/hoozdis/wsgi.py'.
[Thu Jun 25 08:01:43.556611 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] Traceback (most recent call last):
[Thu Jun 25 08:01:43.556685 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] File "/home/ymorin007/webapps/hoozdis_com/src/hoozdis/wsgi.py", line 31, in <module>
[Thu Jun 25 08:01:43.556695 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] application = get_wsgi_application()
[Thu Jun 25 08:01:43.556748 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] File "/home/ymorin007/webapps/hoozdis_com/lib/python3.4/Django-1.8.2-py3.4.egg/django/core/wsgi.py", line 14, in get_wsgi_application
[Thu Jun 25 08:01:43.556757 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] django.setup()
[Thu Jun 25 08:01:43.556799 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] File "/home/ymorin007/webapps/hoozdis_com/lib/python3.4/Django-1.8.2-py3.4.egg/django/__init__.py", line 18, in setup
[Thu Jun 25 08:01:43.556818 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] apps.populate(settings.INSTALLED_APPS)
[Thu Jun 25 08:01:43.556861 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] File "/home/ymorin007/webapps/hoozdis_com/lib/python3.4/Django-1.8.2-py3.4.egg/django/apps/registry.py", line 78, in populate
[Thu Jun 25 08:01:43.556870 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] raise RuntimeError("populate() isn't reentrant")
[Thu Jun 25 08:01:43.556903 2015] [wsgi:error] [pid 6066:tid 140229247973120] [remote 127.0.0.1:160] RuntimeError: populate() isn't reentrant
[Thu Jun 25 08:01:43.846673 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] mod_wsgi (pid=6067): Target WSGI script '/home/ymorin007/webapps/hoozdis_com/src/hoozdis/wsgi.py' cannot be loaded as Python module.
[Thu Jun 25 08:01:43.846748 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] mod_wsgi (pid=6067): Exception occurred processing WSGI script '/home/ymorin007/webapps/hoozdis_com/src/hoozdis/wsgi.py'.
[Thu Jun 25 08:01:43.846787 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] Traceback (most recent call last):
[Thu Jun 25 08:01:43.846843 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] File "/home/ymorin007/webapps/hoozdis_com/src/hoozdis/wsgi.py", line 31, in <module>
[Thu Jun 25 08:01:43.846850 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] application = get_wsgi_application()
[Thu Jun 25 08:01:43.846881 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] File "/home/ymorin007/webapps/hoozdis_com/lib/python3.4/Django-1.8.2-py3.4.egg/django/core/wsgi.py", line 14, in get_wsgi_application
[Thu Jun 25 08:01:43.846888 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] django.setup()
[Thu Jun 25 08:01:43.846914 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] File "/home/ymorin007/webapps/hoozdis_com/lib/python3.4/Django-1.8.2-py3.4.egg/django/__init__.py", line 18, in setup
[Thu Jun 25 08:01:43.846920 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] apps.populate(settings.INSTALLED_APPS)
[Thu Jun 25 08:01:43.846946 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] File "/home/ymorin007/webapps/hoozdis_com/lib/python3.4/Django-1.8.2-py3.4.egg/django/apps/registry.py", line 78, in populate
[Thu Jun 25 08:01:43.846952 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] raise RuntimeError("populate() isn't reentrant")
[Thu Jun 25 08:01:43.846973 2015] [wsgi:error] [pid 6067:tid 140229178517248] [remote 127.0.0.1:172] RuntimeError: populate() isn't reentrant
Frozen modules are modules written in Python whose compiled byte-code
object is incorporated into a custom-built Python interpreter by
Python’s freeze utility. See Tools/freeze/ for now.
From https://docs.python.org/2/library/imp.html#imp.init_frozen
It looks like somewhere someone's freezing some python code and not including all the necessary bits? It's a little tricky to diagnose after that. Try looking for something called sysmon locally.