Skip to main content

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:

  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)

...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-track-affiliate-0.0.2.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

django_track_affiliate-0.0.2-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file django-track-affiliate-0.0.2.tar.gz.

File metadata

  • Download URL: django-track-affiliate-0.0.2.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for django-track-affiliate-0.0.2.tar.gz
Algorithm Hash digest
SHA256 8eb183cd9d84e019c1125b2d0f880945f51ec405fe1a7aac4fa598b83d8169e3
MD5 10182db5aa8f4e020211c9b019b9d118
BLAKE2b-256 d7f6a472c4b4e8c1262be747f8a29a0d805c91037d566e31c968f43039ab75de

See more details on using hashes here.

File details

Details for the file django_track_affiliate-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: django_track_affiliate-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for django_track_affiliate-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6ade6f25cca13aace2120dea834d8db692a4e40c816fd35949d411e411ad841f
MD5 1cc10197f5c5bdc6a56ecde5e011249c
BLAKE2b-256 f49a0fd03dc08a0d9594b7299e5d83d182004468a94d3c8d5d25bb180d682438

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page