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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 267f5cca75f8c616d8fafa96c21f0a74e5ab9123a2e3844ae77b82b16fcc6927 |
|
MD5 | 259f8ffcf266ef365d2a7efffc2a704a |
|
BLAKE2b-256 | fdbdc9e39ca567b15a80103d2526a73f33805b129765e497a6ec1cd659000718 |
Hashes for django_track_affiliate-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45ca5e64463cd292a917547131277cc38244a48a42655449afe730499e830c49 |
|
MD5 | fc40aef37bac8eea6c5b87918698ac96 |
|
BLAKE2b-256 | 4d8a9c79cf267d6b800ec05cb66619f993d1685963997833fbbaecd9e54b2f60 |