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.dev3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7fc7da0243d3d37f8c76fc5f5f22660c24d049a6bce1a9a34d1d2e6836d2c61 |
|
MD5 | 11a022acaea3a7279d9d3077d4e8eb92 |
|
BLAKE2b-256 | b07f9b6435c4cb6882d9270152ae798d720e2b8b359f13d892e6ba838ca0a3af |
Hashes for django_recommend-0.1.dev3-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 646cf8df1a9486aba3601727f6602042904ff09c6bc851fe2e7ba00afc3a57de |
|
MD5 | 8a93410d0b4d11373dc123785db7842b |
|
BLAKE2b-256 | ed37a1c8177b69ea6b15b9697e8ac4ffcf8ca06318ce91c01d9d5a06f3b27601 |