Новая HTML страница к существующей странице - PullRequest
0 голосов
/ 24 января 2020

У меня есть страница HTML, которая содержит некоторые детали. Я хотел бы добавить список блогов ниже. Список блогов разбит на страницы в том же виде.

Вид

class WhoWeAreView(TemplateView):
    template_name = 'who_we_are.html'

    @csrf_exempt
    def get(self, request, *args, **kwargs):
        whoweare_data = WhoWeAre.objects.all()

        blog_list = Blog.objects.all()

        page = request.GET.get('page', 1)
        paginator = Paginator(blog_list, 4)
        try:
            blogs = paginator.page(page)
        except PageNotAnInteger:
            blogs = paginator.page(1)
        except EmptyPage:
            blogs = paginator.page(paginator.num_pages)

        context = {
            'whoweare': whoweare_data,
            'blog': blogs,

        }
        return render(request, self.template_name, context)

Шаблон

    <div class="row">
    {% for whoweare in whoweare %}
    <div class="col s12 m6 l4">
        <div class="team-member">

            <div class="team-img"><img src="{{ MEDIA_URL }}{{ whoweare.logo.url }}" width="55"
             height="55"></div>
             <h3 class="team_name">{{ whoweare.tittle }} </h3>
             <p class="team_text">{{ whoweare.description }} </p>
         </div>

     </div>
     {% endfor %}

 </div>
    {% for blog in blog %}
    <div class="container-full">

        <div class="who_mainhead">{{ blog.tittle }}</div>

        <div class="who_maintext">{{ blog.short_description }}

        </div>

    </div>
    {% endfor %}


{% if blog.has_next %}

<div class="who_bigbtnblock">
    <a href="?page={{ blog.next_page_number }}">

        <button class="btn waves-effect waves-light who_mainbtn_big" type="submit"
        name="action">
        View More
    </button>
</a>
</div>

{% endif %}

Работает нумерация страниц. Разбитые на страницы данные должны быть продолжением той же страницы, согласно моему требованию. Но теперь он перезагружает всю страницу

Существующая структура

whoweare_data

blog_1
blog_2
blog_3
blog_4

View more (button)

when I click this view more the entire page is reloading and come like this structure

whoweare_data

blog_5
blog_6
blog_7
blog_8

View more (button)

Ожидаемая структура

whoweare_data

blog_1
blog_2
blog_3
blog_4

View more (button)

blog_5
blog_6
blog_7
blog_8

как мне это сделать .?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...