django-referer
django-referer is a Django app for displaying different referer details based on query parameter. It provides sales, partners and affiliates custom links to send out to the public. It gives sales, partners and affiliates their opportunity to convert every contact detail on the website to their own. It thus encourages sales, partners and affiliates to promote the website and the business. Also, with the help of analytics scripts, there will be information about which sales gets most clicks.
Installation
Use the package manager pip to install django-referer.
pip install django-referer
Usage
Step 1. Add referer middleware (in settings.py file)
MIDDLEWARE = [
'referer.middleware.referer.RefererMiddleware', # here
'django.middleware.security.SecurityMiddleware',
'...'
]
Step 2. Add referer context processors (in settings.py file)
TEMPLATES = [
{
'OPTIONS': {
'context_processors': [
'...',
'django.contrib.messages.context_processors.messages',
'referer.context_processors.referer', # here
],
},
},
]
Step 3. Customize referer settings (in settings.py file) (optional)
The defaults are:
REFERER_LINK_PARAMETER = 'referer'
REFERER_DEFAULT_ID = 1
# ?referer=1
REFERER_MODEL_FROM = 'django.contrib.auth.models'
REFERER_MODEL_IMPORT = 'User'
# from REFERER_MODEL_FROM import REFERER_MODEL_IMPORT
REFERER_IGNORED_LINKS = []
Step 4. Display referer information (in .html file)
<a href="mailto:{{ referer.email }}">Email</a>
<p>{{ referer.first_name }} {{ referer.last_name }}</p>
Contributing
Pull requests are welcome.
License
Metadata
Release files for django-referer 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django-referer-0.0.2.tar.gz | 3.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_referer-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.9 kB
Release files / django-referer-0.0.2.tar.gz
| Download URL | django-referer-0.0.2.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8af8783549e5418c477980c91c0207514ba509b5ef0aeb52692fb268ac4f626b
|
|
BLAKE2b-256 checksum How to use checksums |
b757d56a11a01a667247e4d0b6cc30e31ca79f661ae44c7fe052bb4710205dfb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
|
Release files / django_referer-0.0.2-py3-none-any.whl
| Download URL | django_referer-0.0.2-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bd0b3eb119a4f3dd4bc373620d5f7edb79ebacf29191a726d08f992f5cd7edc4
|
|
BLAKE2b-256 checksum How to use checksums |
4943ebc435a8323a87bf9eb2e8436d72e60fd5ed68439aea85d0eff385a2f0e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
|