Я использую пакет coleifer / Django-Relationships для своего проекта. У меня были тяжелые времена, чтобы заставить его работать.
Я включил шаблон 'relations_add.html' в шаблон профилей пользователей, чтобы, когда пользователь находит другого пользователя, и если оба не следуют друг за другом, пользователю было легко нажимать кнопку «следовать», чтобы следовать друг друга.
После включения шаблона в шаблон профиля пользователя:
{% include 'relationships/relationship_add.html' %}
Я получаю TemplateSyntaxError в / profile / picomon /
RelationshipStatus not found
Request Method: GET
Request URL: http://127.0.0.1:8000/profiles/picomon/
Django Version: 1.3.1
Exception Type: TemplateSyntaxError
Exception Value:
RelationshipStatus not found
Exception Location: build\bdist.win32\egg\relationships\templatetags\relationship_tags.py in render, line 32
Python Executable: C:\Python27\python.exe
Python Version: 2.7.2
Template error
In template c:\python27\scripts\myweb\templates\relationships\relationship_add.html, error at line 9
Ниже приведены коды в Relations / Relations_add.html
{% load relationship_tags %}
{% if request.user != profile.user %}
{# decide whether or not the current user is following this user #}
{% if_relationship request.user profile.user "following" %}
{# they are following them, so show a "remove" url #}
<a href="{{ profile.user|remove_relationship_url:"following" }}">Unfollow</a>
{% else %}
{# they are not following them, so show a link to start following #}
<a href="{{ profile.user|add_relationship_url:"following" }}">Follow</a>
{% endif_relationship %}
{% else %}
<p>This is you!</p>
{% endif %}
Какую настройку я сделаю, чтобы сделать эту работу? Пожалуйста, сообщите мне, пожалуйста.