Django로 instagram 만들어보기 (10) - 내 프로필

swb·2022년 11월 28일
0

django

목록 보기
10/11
  • 내 프로필에서 내가 올린 게시물, 좋아요 누른 게시물, 북마크한 게시물들을 보여준다.

1. 피드들 가져오기

        {% for feed in bookmark_feed_list %}
            <div style="margin: 10px 5px; width: 300px; height: 300px">
                <div>
                    <img style="object-fit: cover; width: 300px; height: 300px"
                         src="{% get_media_prefix %}{{ feed.image }}">
                </div>
            </div>
        {% endfor %}

2. 3개씩 보여주기

  • 한 줄에 게시물 3개씩 보여주고 밑으로 내려가는 형식 : wrap
<div style="display: flex; flex-direction: row; flex-wrap: wrap; width: 1000px; ">

3. 게시물, 좋아요, 북마크 따로 보여주기

    $('#button_feed_list').click(function () {
        $('#feed_list').css({
            display: 'flex'
        });
        $('#like_feed_list').css({
            display: 'none'
        });
        $('#bookmark_feed_list').css({
            display: 'none'
        });
    });

출처

profile
개발 시작

0개의 댓글