Last active
November 8, 2017 08:07
-
-
Save StarsHu/300690b2a2f52bd1ed55a06b391aec42 to your computer and use it in GitHub Desktop.
django_template_example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for name in names %} | |
<img src="images/{{name}}.png" /> | |
<a href="toggle/?name={{name}}&action=on">开</a><a href="toggle/?name={{name}}&action=off">关</a>' | |
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def index(request): | |
context = {} | |
names = ['first','second','third','fourth'] | |
return render(request,'index.html',{'names': names}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment