Generate recommendations in Django.
Project description
Use pyrecommend in Django projects.
Warning: not yet suitable for production.
django_recommend/ is the actual Django app intended for use in projects.
simplerec/ is a Django project used for testing.
Quickstart
Add django_recommend to your INSTALLED_APPS, and run python manage.py migrate.
Set SESSION_SAVE_EVERY_REQUEST=True in your settings, to ensure anonymous users can be tracked.
In your views, call django_recommend.set_score(request, object, score) to start recording user scores. (Currently this is assumed to be implicit feedback.) Note: This will use session keys to store scores for users who aren’t authenticated.
In your templates, use {% load django_recommend %} and {{ obj|similar_objects }} to show similar objects to visitors. This filter returns a list, so you may also do, for example:
{% load django_recommend %} {% with similar_products as product|similar_objects %} {% if similiar_products %} <h2>Other users also liked:</h2> <ul> {% for product in similar_products %} <li><a href=
"{{ product.get_absolute_url }}">{{ product }}</a></li> {% endfor %} </ul> {% endif %} {% endwith %}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-recommend-0.1.dev5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b68383be25240743bedc042b141beebd15f54d4b753075a59a85420ecbbb2a06 |
|
MD5 | 62c503a1a692e2df2fd95bc8be121c0c |
|
BLAKE2b-256 | c5e1c7c71e62e1715dcf6ce842342b579a3c586cbc518befd74189deaae2c837 |
Hashes for django_recommend-0.1.dev5-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab87f77d76d02b07971c68f920f88ae16ee6500fe57b01e04a10bd713fdc0f43 |
|
MD5 | 4c0a0f2aa80f08d4a0580c01530ff0f6 |
|
BLAKE2b-256 | eb69c0ae4a8f8a4bb0b899caa6783e79e455a78c4171f3a4d0eb047d21773f1e |