Django

myapp

views.py

from django.shortcuts import render, HttpResponse

def index(request):
    return HttpResponse(‘Welcome’)
    
def create(request):
    return HttpResponse(‘Create’)

def read(request, id):
    return HttpResponse(‘Read!’ +id)

*1. index() create(), read(구멍, 구멍2)

urls.py

from django.urls import path
from myapp import views

urlpatterns = [
    path = (‘’, views.index),
    path = (‘create/‘, views.create),
    path = (‘read/<id>’, views.read)
    ]

 

댓글

댓글 본문
버전 관리
빅타임
현재 버전
선택 버전
graphittie 자세히 보기