django.core.exceptions.ImproperlyConfigured: Requested setting LOGGING_CONFIG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
# -*- coding: utf-8 -*-
import json
import os
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "just_test.settings")
django.setup()
from datetime import datetime
from django.conf import settings
from django.core.management import execute_from_command_line
Test Event Name
importing
Response
{
"errorMessage": "Error loading MySQLdb module.\nDid you install mysqlclient?",
"errorType": "ImproperlyConfigured",
"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 _l
https://stackoverflow.com/questions/55695187/import-libraries-in-lambda-layers
https://stackoverflow.com/questions/50970188/did-you-install-mysqlclient/54200666
https://stackoverflow.com/questions/45992303/using-django-orm-inside-an-aws-lambda-function
메모리 사이즈 문제인 것으로 보인다.
람다 함수의 서브넷에 퍼블릭 서브넷 제거
NAT 존재하는 프라이빗 서브넷만 남겨둠
여전히 품절처리 함수가 잘 작동하고, DB에도 적용은 되나,
에러 로그로 나오는 현상 발생
--> 현재 리서치 중