Re: Questions about the use of for loops in django

2022-12-17 Thread jiang hao
I have solved this problem, it is my backend code's problem   :(

jiang hao在 2022年12月18日星期日上午7:59:15 [UTC+8]寫道:

> I use a for loop in django. When I refresh the browser, the result of the 
> first for loop is not cleared, and the result of the second for loop is 
> stitched together with the first one.
>
> test.html:
>
> 
> 
> 
> 
> Test
> 
> 
> 
> 
> 
> full_name
> html_url
> description
> stargazers_count
> 
> 
> 
> {% for item in resp_list %}
> 
> {{ item.full_name }}
> {{ item.html_url }}
> {{ item.description }}
> {{ item.stargazers_count }}
> 
> {% endfor %}
> 
> 
> 
> 
>
>
> Among them, the resp_list here is a list obtained by saving the content I 
> crawled from the Internet using python's requests library.
>
> When I ran the program for the first time, there was no problem. When I 
> refreshed my browser, the first loop was not cleared, which caused the 
> second loop to be followed by the first loop.
>
> I'm desperate for your help, thanks to everyone here!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/607b0352-242a-4a74-9702-ebde4da7601bn%40googlegroups.com.


Questions about the use of for loops in django

2022-12-17 Thread jiang hao
I use a for loop in django. When I refresh the browser, the result of the 
first for loop is not cleared, and the result of the second for loop is 
stitched together with the first one.

test.html:





Test





full_name
html_url
description
stargazers_count



{% for item in resp_list %}

{{ item.full_name }}
{{ item.html_url }}
{{ item.description }}
{{ item.stargazers_count }}

{% endfor %}






Among them, the resp_list here is a list obtained by saving the content I 
crawled from the Internet using python's requests library.

When I ran the program for the first time, there was no problem. When I 
refreshed my browser, the first loop was not cleared, which caused the 
second loop to be followed by the first loop.

I'm desperate for your help, thanks to everyone here!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/162ab47c-68e5-4625-b99e-b4eac1bcd4a1n%40googlegroups.com.