장고에서의 요청 처리 View 함수를 통한 클라이언트 요청 처리 1/3 import json from django.http import HttpResponse, HttpRequest def index(request: HttpRequest): # 단순 text 문자열 content = "HELLO WORLD" # HTML 문자열 # 복잡한 문자열 조합은 템플릿 엔진을 활용하면 편리하다. content = """HELLO WORLD""" # 개체를 json 문자열로 변환(직렬화, Serialize) post_list = [ {"title" : "안녕 파이썬", "author" : "Jack"}, {"title" : "안녕 장고", "author" : "Snider"} ] content = json.dumps..
[Django] 장고에서의 요청 처리
장고에서의 요청 처리 View 함수를 통한 클라이언트 요청 처리 1/3 import json from django.http import HttpResponse, HttpRequest def index(request: HttpRequest): # 단순 text 문자열 content = "HELLO WORLD" # HTML 문자열 # 복잡한 문자열 조합은 템플릿 엔진을 활용하면 편리하다. content = """HELLO WORLD""" # 개체를 json 문자열로 변환(직렬화, Serialize) post_list = [ {"title" : "안녕 파이썬", "author" : "Jack"}, {"title" : "안녕 장고", "author" : "Snider"} ] content = json.dumps..
2023.12.14