13
프로파일 링하려는 이메일에 app이라는 함수가 있습니다.Python 용 cProfile이 함수 이름을 인식하지 못합니다.
exec cmd in globals, locals
File "<string>", line 1, in <module>
NameError: name 'send_email' is not defined
나는 여기에 놓치고 무엇 :이 그런 짓을 할 때 나는이 관리 명령을 실행하면, 그것은 다음과 같은 오류가 발생, 최대
from django.core.management import BaseCommand
import cProfile
class Command(BaseCommand):
def handle(self, *args, **options):
from email.modname import send_email
cProfile.run('send_email(user_id=1, city_id=4)')
불면? cProfile은 문자열 (전역/로컬 네임 스페이스에서 func 이름 찾기)을 어떻게 평가합니까?
감사합니다. Rik, 가장 확실하게 작동했습니다. – Ben