问题描述:

I'm developing a large scale consumer site with django for my masters project. Basically, I would like to track everything that a user searches for/clicks on etc, so as to make recommendations a'la amazon's "recommended for you" sections.

Are there any good resources for doing this? I don't know whether I should be storing this in logs, or in a model, or what. I've never done anything like this before.

I'm having trouble finding many resources to help me on this, perhaps because I don't really know what to even search for, so any suggestions or nudges in a direction would be most appreciated.

网友答案:

I'm currently using exactly this to keep a track of all my user and their activity,

class ActivityLog(models.Model):
    actor = models.ForeignKey(settings.AUTH_USER_MODEL, null=True)
    action_type = models.CharField(max_length=50)
    act_meta = HStoreField(blank=True, null=True)
    timestamp = models.DateTimeField(auto_now_add=True)

'act-meta' stores all the details particular to that user event. Since i didn't want this everywhere on my website, i'm not using it via middleware. But i'm using this for a recommendation system and it works just fine.

网友答案:

I recommend a middlware that can take requests and responses then store them to a database table..you can store everything such such as path, files, all what you need.

相关阅读:
Top