Django - how to follow some object (not user)
<p>Problem with follow button in django.</p>

<p>I have a web-site with database of some events. Registered users should be able to follow this events. I mean there should be a button "Follow" on an event page. Users who clicked it should see this event on their home page. But i just cant understand how it should work...</p>

<p>There is event model:</p>

<pre><code>class Event(models.Model):
    name = models.CharField(max_length=26)
    second_name = models.CharField(max_length=60)
    description = models.CharField(max_length=200)
    type = models.CharField(max_length=3, default='cin')
    date = models.DateField()
    user = models.ForeignKey(User)
    image = models.ImageField(
        upload_to='images/',
        default='images/default.png'
    )
</code></pre>

<p>And i have a view to output events on a page:</p>

<pre><code>def home(request):
    all_events = Event.objects.all.order_by('date')
    return render(request, 'events/home.html', {'events': all_events})
</code></pre>

<p>in template - </p>

<pre><code>{% block content %}
    &lt;h1&gt;{{ Event.name }}&lt;/h1&gt;
    &lt;pre&gt;{{ Event.date }}&lt;/pre&gt;
    &lt;pre&gt;{{ Event.description }}&lt;/pre&gt;
{% endblock %}
</code></pre>

<p>I tried to use ManyToManyField like <a href="https://stackoverflow.com/questions/31845109/how-to-follow-on-a-button-click-in-django">this</a> but i dont understand exactly how it should work - what code should be in views.py, models.py and in template (button). Please help me</p>