인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

nyeongna's profile image
nyeongna

asked

[Renewal] Introduction to Python Backend and Web Technologies for Beginners (Python Intermediate, Backend and Web Technology Basics Understood with Flask) [Full Stack Part1-1]

Flask various features: Various Decorators (Update)

After_request 질문입니다

Written on

·

171

0

안녕하세요. 강의 잘 보고 있습니다.

다름이 아니고 after_request에 관한 질문입니다.

밑에 똑같은 질문이 있긴한데 봐도 잘 이해가 안가서 다시한번 질문드립니다.

실행순서가 궁금한데

before_request -> route -> after_request가 맞는지 확인차 질문드립니다.

즉 요청이 들어와서 before_reqeust 부분 출력하고, .route 부분이 실행되고 .route의 return인 "<h1>Hello Flask!</h1>을 인자로 받은 after_request가 실행이 되고 after_request 부분이 출력되고 마지막에 route로 부터 받은 부분을 return 해주게 되는게 순서가 맞을까요?

즉, route부분에서 브라우저로 바로 return해주는게 아니라 after_request에서 route의 return을 받고 after_request에서 브라우저로 return해주는게 맞나요?

pythonrest-apiflask

Answer 1

0

funcoding님의 프로필 이미지
funcoding
Instructor

안녕하세요.

맞습니다. 혹시 그래도 이해가 안가신다면, 다음 블로그도 참고해보시면 조금더 이해하실 수 있지 않을까 하는데 어떠신가요?

https://scribblinganything.tistory.com/176

nyeongna's profile image
nyeongna

asked

Ask a question