A Django app to help manage and track affiliate programmes
Project description
diddemo-track-affiliate
Django track affiliate is a Django app that allows you to manage affiliate programmes
Quick start:
- Ensure you have the following packages installed
pip install pyyaml ua-parser user-agent django-user-agent geoip2
-
Add "affiliate" and "django_user_agent" to your INSTALLED_APPS setting like this.
INSTALLED_APPS = [ ... 'django_user_agent', 'django_sus', ]
-
Add 'django_user_agents.middleware.UserAgentMiddleware', to middleware
MIDDLEWARE = [
... 'django_user_agents.middleware.UserAgentMiddleware', ...
]
-
Run "python manage.py makemigrations" to create the models.
-
Run "python manage.py migrate" to migrate your new models
-
Add the following decorator to your main url i.e. home. This will create the necessary AffiliateTracker object against a session key
from affiliate.decorators import affiliate_tracker
@method_decorator(affiliate_tracker, name='dispatch') class HomeView(TemplateView):
template_name = "main/index.html"
- call the AFCreate class in your sign up view
from affiliate.manager import AFCreate def sign_up(request):
...
#add this before calling login()
session_key = self.request.session.session_key
login(self.request, user)
#add after calling login()
AFCreate(request, session_key = session_key, user = user)
...
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-track-affiliate-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8eb183cd9d84e019c1125b2d0f880945f51ec405fe1a7aac4fa598b83d8169e3 |
|
MD5 | 10182db5aa8f4e020211c9b019b9d118 |
|
BLAKE2b-256 | d7f6a472c4b4e8c1262be747f8a29a0d805c91037d566e31c968f43039ab75de |
Hashes for django_track_affiliate-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ade6f25cca13aace2120dea834d8db692a4e40c816fd35949d411e411ad841f |
|
MD5 | 1cc10197f5c5bdc6a56ecde5e011249c |
|
BLAKE2b-256 | f49a0fd03dc08a0d9594b7299e5d83d182004468a94d3c8d5d25bb180d682438 |