[Question] Possible reasons of getting Unable to import core.wsgi.application with Django app? #206
Unanswered
ShahriyarR
asked this question in
Q&A
Replies: 2 comments
-
I am having the exact same issue |
Beta Was this translation helpful? Give feedback.
0 replies
-
I have figured out the reason. In that cases please run the Lambda function directly and see the output. Test Event Name
test
Response
{
"errorMessage": "Unable to import core.wsgi.application",
"errorType": "Exception",
"stackTrace": [
" File \"/var/lang/lib/python3.8/imp.py\", line 234, in load_module\n return load_source(name, filename, file)\n",
" File \"/var/lang/lib/python3.8/imp.py\", line 171, in load_source\n module = _load(spec)\n",
" File \"<frozen importlib._bootstrap>\", line 702, in _load\n",
" File \"<frozen importlib._bootstrap>\", line 671, in _load_unlocked\n",
" File \"<frozen importlib._bootstrap_external>\", line 843, in exec_module\n",
" File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed\n",
" File \"/var/task/wsgi_handler.py\", line 115, in <module>\n wsgi_app = import_app(config)\n",
" File \"/var/task/wsgi_handler.py\", line 48, in import_app\n raise Exception(\"Unable to import {}\".format(config[\"app\"]))\n"
]
} Again nothing informative. Function Logs
START RequestId: 071448c6-7dc3-4830-ad3d-a20519d7a65b Version: $LATEST
Traceback (most recent call last):
File "/var/task/wsgi_handler.py", line 43, in import_app
wsgi_module = importlib.import_module(wsgi_fqn_parts[-1])
File "/var/lang/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 843, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/var/task/core/wsgi.py", line 16, in <module>
application = get_wsgi_application()
File "/opt/python/django/core/wsgi.py", line 12, in get_wsgi_application
django.setup(set_prefix=False)
File "/opt/python/django/__init__.py", line 19, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "/opt/python/django/conf/__init__.py", line 82, in getattr
self._setup(name)
File "/opt/python/django/conf/__init__.py", line 69, in _setup
self._wrapped = Settings(settings_module)
File "/opt/python/django/conf/__init__.py", line 170, in init
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/var/lang/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 843, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/var/task/core/settings/local.py", line 6, in <module>
import('pysqlite3')
ModuleNotFoundError: No module named 'pysqlite3'
[ERROR] Exception: Unable to import core.wsgi.application
Traceback (most recent call last):
File "/var/lang/lib/python3.8/imp.py", line 234, in load_module
return load_source(name, filename, file)
File "/var/lang/lib/python3.8/imp.py", line 171, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 702, in _load
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 843, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/var/task/wsgi_handler.py", line 115, in <module>
wsgi_app = import_app(config)
File "/var/task/wsgi_handler.py", line 48, in import_app
raise Exception("Unable to import {}".format(config["app"]))END RequestId: 071448c6-7dc3-4830-ad3d-a20519d7a65b
REPORT RequestId: 071448c6-7dc3-4830-ad3d-a20519d7a65b Duration: 1274.90 ms Billed Duration: 1275 ms Memory Size: 1024 MB Max Memory Used: 33 MB
Unknown application error occurred. The main error is -> import('pysqlite3')
ModuleNotFoundError: No module named 'pysqlite3' But instead of giving actual error it gives generalized error: [ERROR] Exception: Unable to import core.wsgi.application That is definitely a problem. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Got the following error from the API Gateway:
serverless.yml
file:Beta Was this translation helpful? Give feedback.
All reactions