def set_unusable_password(self):
# Создает "ниюзабельный" пароль, который при вызове метода check_password будет возвращать False
self.password = make_password(None)
def has_usable_password(self):
return is_password_usable(self.password)
template = get_template("%s/base.html" % request.domain)
"domain_base_template": "%s/base.html" % request.domain
{% extends domain_base_template %}
from games.models import Game
def most_popular_games(request):
return { "MOST_POPULAR_GAMES": Game.objects.filter(active=True).order_by("-rating", "-id")[:5] }
TEMPLATE_CONTEXT_PROCESSORS = (
...
"download_games.context_processors.most_popular_games",
...
}
{% for game in MOST_POPULAR_GAMES %}
...
{% endfor %}