ubiquitousthey / django-mvtester Goto Github PK
View Code? Open in Web Editor NEWA Django app to help with multivariate testing
License: Apache License 2.0
A Django app to help with multivariate testing
License: Apache License 2.0
In the middleware function process_template_response, the following line is used:
request.session[EXPERIMENT_PREFIX+treatment.experiment.slug] = treatment.slug
This sets the treatment.slug in the session (not the treatment.id). What if there are +2 treatments with the same treatment.slug?
The treatment.slug is later retrieved in middleware function process_view, to reverse find the Treatment it belongs to.
treatment_slug = request.session[EXPERIMENT_PREFIX+goal.experiment.slug]
treatment = Treatment.objects.get(slug=treatment_slug)
If +2 Treatments use the same treatment.slug, then the developer cannot be sure which will be retrieved (or perhaps an error will occur?)
Unfortunately, I'm not able to run the /example because I'm using django-nonrel on my system. I'm trying to gather as much understanding as I can by reading the code. I will have to modify the code to work with django-nonrel anyway, so I'm just figuring out how. I have deciphered the middleware, but I cannot seem to figure out how much of the rest works. Anyway, I just think it would be good if the documentation clearly laid out the logical flow of how this software is intended to work.
There are a few misspellings through out the code, including the word "experiment".
In decorators.py, the function has_template_experiements is misspelled (usage of it's misspelling also in the /example/view.py).
Running a spell check on the files should resolve the issue.
In the middleware, a database call is made to find goals that match the currently running experiments.
experiments = request.session.get(ACTIVE_EXPERIMENTS,[])
for goal in Goal.objects.filter(experiment__id__in=experiments,experiment__url_pattern__isnull=False):
If there are no experiments, is the database still accessed, or does the filter recognize this and return an empty set without accessing the database?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.