New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added tracking system #100

Closed
wants to merge 5 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@ZuluPro
Contributor

ZuluPro commented Apr 16, 2016

A cookie actually named track_key is used for track visitors.
All are recorded in a request.tracking.models.Visitor and request.tracking.models.Visit.
Recorded by request.middleware.RequestMiddleware only if 'request.tracking' is in INSTALLED_APPS.

I added a Plugin to show active visitors in overview.
I added features for matching with those definitions: https://en.wikipedia.org/wiki/Web_analytics#On-site_web_analytics_-_definitions

Say me what you think about,
And if it is integrable in django-request or if I should made another repository.
I'll add a lot of plugins for visualize more and more data.

PS: The failing test is isort, maybe its configuration isn't enough dynamic ?

@ZuluPro ZuluPro force-pushed the ZuluPro:tracking branch from 8b2e85c to 1bd401d Apr 17, 2016

@felixxm

This comment has been minimized.

Collaborator

felixxm commented Apr 17, 2016

Sort imports correctly. View test output for more details.

@ZuluPro ZuluPro force-pushed the ZuluPro:tracking branch from 1bd401d to fde8b61 Apr 17, 2016

@ZuluPro

This comment has been minimized.

Contributor

ZuluPro commented Apr 17, 2016

Hey @felixxm, I wanted to ping you for ask what do you think about this PR ?

About isort, don't you think it is too strict, it fails for simple things and there's no PEP about, I've got few example:

  • I wrote: from django.test import TestCase, RequestFactory before from django.http import HttpResponse
    In my mind, I'm in a test module, so I put import TestCase before.
  • I didn't add blank line between import kinds, but there are only 5 imports, too less I think
  • I wrote from request.tracking.models import Visitor, Visit but it would like from request.tracking.models import Visit, Visitor. Elements sorting is time consuming.

All that for say, I don't think we could say a commit is in error if it doesn't follow the previous examples, particularly the last.

@ZuluPro ZuluPro force-pushed the ZuluPro:tracking branch 2 times, most recently from 107fc81 to e157ba5 Apr 17, 2016

@ZuluPro

This comment has been minimized.

Contributor

ZuluPro commented Apr 20, 2016

@felixxm , @kylef : Any news ?

@ZuluPro ZuluPro force-pushed the ZuluPro:tracking branch from e157ba5 to 4d41b49 Apr 26, 2016

req.from_http_request(request, response)

if settings.USE_TRACKING:
if 'track_key' in request.COOKIES:

This comment has been minimized.

@kylef

kylef May 20, 2016

Collaborator

What about making the key customisable? Perhaps there could be a setting for it.

This comment has been minimized.

@kylef

kylef May 20, 2016

Collaborator

I'd also suggest we prefix the key name.

This comment has been minimized.

@ZuluPro

ZuluPro May 24, 2016

Contributor

Agree with the 2 comments

req = Request()
req.from_http_request(request, response)

if settings.USE_TRACKING:

This comment has been minimized.

@kylef

kylef May 20, 2016

Collaborator

Can we prefix the setting with REQUEST_ like the others please.

This comment has been minimized.

@kylef

kylef May 20, 2016

Collaborator

Ah, now I see #103

@ZuluPro

This comment has been minimized.

Contributor

ZuluPro commented May 24, 2016

@kylef @felixxm
I began a fork of django-request for work faster, it is pony-traffic.

If you have ten minutes for test it, it could be great.
This fork has the following features:

  • Visit and Visitor as explain in this PR
  • GeoIP with a map in the overview
  • New plugins for data provided by visit and visitor models
  • New traffic plugins (curves in overview chart)
  • New admin filters to see specific requests, visitors and visits

These are only options, if you don't add 'request.tracking' in INSTALLED_APPS, you have a classic django-request.

All is not fully accurate, example: the issue referenced here #105.

I really would like to merge that work and I could make it step by step. But simply, what do you think about all that ?

Should we make a separated project ? With a signal in the middleware it will become easier to plugin anything.

@devdlabs

This comment has been minimized.

devdlabs commented Jun 1, 2016

@ZuluPro I like your idea , what about tracking multiple sites with celery, like sentry does for bug tracking ?

@ZuluPro

This comment has been minimized.

Contributor

ZuluPro commented Jun 1, 2016

@devdlabs I don't know how sentry do that, but I plan to use Celery for record asynchronously. Thank for your encouragement.

@ZuluPro ZuluPro closed this Aug 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment