핀터레스트 클론코딩

    [pinterest clone (6)] html (include / extends)

    base.html 에서 head를 잘라내고 templates/head.html을 새로 만들었다. head.html base.html {% include 'head.html' %} 1 2 3 {% include 'head.html' %} 이게 include 구문이다. 이런식이면 vue의 component랑 비스무리?하게 쓸 수 있을거 같다. runserver에서 봐도 잘 나타난다. 1 header랑 footer는 계속 재활용할거니까 include로 빼주자. : header.html, footer.html 만들어빼고 include로 넣어주기 {% include 'head.html' %} {% include 'header.html' %} {% include 'footer.html' %} 2 header, fo..

    [pinterest clone (3)] Accountapp

    1. python manage.py startapp accountapp (account보다 accountapp 이런식으로 이름 정확히붙이는거 좀 괜찮은 방식인거같음. 앞으로 이렇게 굳혀야겠다) 2. platypus/settings.py에 accountapp을 INSTALLED_APPS에 추가 3. 브라우저에서 어떤 경로로 접속하게 되면 그 경로에서 헬로월드 같은 기본 출력해주는 view만들어보자 from django.http import HttpResponse def hello_world(request): return HttpResponse('Hello world!') request 넣으면 주소로 헬로월드 돌려주고 끝! 4. 라우팅 만든 뷰를 보기 위해서는 뷰로 연결을 시켜주는게 필요하다. -> 라우팅 ..