Skip to main content

diddemo-track-affiliate

Django track affiliate is a Django app that allows you to manage affiliate programmes

Quick start:

  1. Ensure you have the following packages installed

pip install pyyaml ua-parser user-agent django-user-agent geoip2

  1. Add "affiliate" and "django_user_agent" to your INSTALLED_APPS setting like this.

    INSTALLED_APPS = [ ... 'django_user_agent', 'django_sus', ]

  2. Add 'django_user_agents.middleware.UserAgentMiddleware', to middleware

    MIDDLEWARE = [

    ... 'django_user_agents.middleware.UserAgentMiddleware', ...

]

  1. Run "python manage.py makemigrations" to create the models.

  2. Run "python manage.py migrate" to migrate your new models

  3. 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"
  1. 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)

...

Metadata

Release files for django-track-affiliate 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-track-affiliate 0.0.2
File Size Uploaded
django-track-affiliate-0.0.2.tar.gz 7.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-track-affiliate 0.0.2
File Interpreter ABI Platform
django_track_affiliate-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 17.3 kB

Release files / django-track-affiliate-0.0.2.tar.gz

Download URL django-track-affiliate-0.0.2.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8eb183cd9d84e019c1125b2d0f880945f51ec405fe1a7aac4fa598b83d8169e3
BLAKE2b-256 checksum
How to use checksums
d7f6a472c4b4e8c1262be747f8a29a0d805c91037d566e31c968f43039ab75de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.3

Release files / django_track_affiliate-0.0.2-py3-none-any.whl

Download URL django_track_affiliate-0.0.2-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ade6f25cca13aace2120dea834d8db692a4e40c816fd35949d411e411ad841f
BLAKE2b-256 checksum
How to use checksums
f49a0fd03dc08a0d9594b7299e5d83d182004468a94d3c8d5d25bb180d682438
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.3

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page