D
D
Domohod2021-04-28 20:18:42
Django
Domohod, 2021-04-28 20:18:42

How to make voting in Django 3?

there is a home.html file:

{% extends 'B_or_W/main-layout.html' %}

{% block home %}

<body class="body">


</form>

<font face="Montserrat">

    <a href="{% url 'purple' %}">
    <div class="or">
        <h1 class="text"><big>or</big></h1>
    </div>
    </a>

    <a href="{% url 'black' %}">
    <div class="Black">
        <h1 style="color: white" class="a_b">Black</h1>
    </div>
    </a>

    <a style="color: black" href="{% url 'white' %}">
    <div class="White">
        <h1 class="a_w">White</h1>
    </div>
     </a>

</font>
</body>

{% endblock %}


when passing through

<a href="{% url 'black' %}">
    <div class="Black">
        <h1 style="color: white" class="a_b">Black</h1>
    </div>
    </a>


the user visits black.html:

{% extends 'B_or_W/main-layout.html' %}

{% block home %}

<body bgcolor="black">
<div>
<font face="Montserrat">

    <div>
        <a href="{% url 'home' %}" class="back_b"><h1 style="color: white"> <span></span> Back</h1></a>
    </div>

    <div class="block_b">
    <div>
        <h1 style="color: black">Choose black</h1><br>
        <button  class="button_b"><h1 style="color: white">Choose</h1></button>
    </div>
    </div>

</font>
</div>
</body>

{% endblock %}


need to pro click on

<button  class="button_b"><h1 style="color: white">Choose</h1></button>


the user's vote was taken into account on home.html
How to do this? (on Django)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
weranda, 2021-06-27
@weranda

1. Pass a parameter to the URL and read it later.
2. Write the voice to local storage, cookie or database and read it during data transfer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question