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:
{% 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.dev4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38e1e6d0817b2218e84ef1906cdf1ad1757efa1c28c1523d18fcd69935baf5c9 |
|
MD5 | 908deae93766245580dc17b7e480f544 |
|
BLAKE2b-256 | 7128e11f78c20be3606524cb2aadf9f5b54d83093ca7cc6cb5011af3bee54d37 |
Hashes for django_recommend-0.1.dev4-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91bdb43e950a6d0d2533baa92e3df953c385d5e372c4c791d44457de674a6380 |
|
MD5 | efd78d326cbd0cf1e93199e77eac559f |
|
BLAKE2b-256 | c31c987f4aadd179c64ec98a7a48b2282b9fb46d5e9be5cbfbbbb986ebe11246 |