IT Curation 자세히보기
728x90

2023/05 10

예제 | Function Based View

from django.shortcuts import render #urls에서 views로 요청이 들어감. # 매개변수가 request로 들어감. def index(request): # 이 변수의 값을 templates쪽으로 넘기기 위하여 값을 대입함. posts = Post.objects.all().order_by('-pk') return render( request, # 이 템플릿을 이용하여 렌더를 하시오. 'blog/Post_list.html', { # key: value 형태로 templates쪽으로 넘김 'posts':posts, } )

ubuntu 20.04 | 고정 ip 설정

ubuntu 20.04에서 network를 설정하는 기본 방식은 netplan을 이용해야 합니다. https://netplan.io/ Netplan | Canonical Netplan Backend-agnostic network configuration in YAML. netplan.io 아래 경로에서 파일 리스트를 출력해봅니다. ubuntu@svr $ /etc/netplan 제 pc기준 00-installer-config.yaml이라는 파일이 있습니다. 아래와 같이 최초 dhcp로 동적ip할당을 받게 구성되어있는데, 해당 파일의 내용을 아래와 같이 수정합니다. # dhcp4 는 no 도되긴하는데 false로 해주세요~ yaml파일이므로 띄어쓰기가 중요하고, 두칸씩띄면 됩니다. enp0s3은 nic장치명..

OS/ubuntu 2023.05.01