Simple app to get mobile app deep linking in place with basic tracking..
Project description
Django Deep Link
Overview
Simple app to get mobile app deep linking in place with basic tracking.
Documentation
The full documentation is at ...
Quickstart
Install Django Deep Link::
pip install django-deep-link
Add it to your INSTALLED_APPS
:
INSTALLED_APPS = (
...
'django_deep_link',
...
)
Add Django Deep Link's URL patterns:
from django_deep_link import urls as django_deep_link_urls
urlpatterns = [
...
path(r"", include(django_deep_link_urls, namespace='django-deep-link')),
...
]
Provide Your Own IP Geodata Handler
import requests
from django.core.cache import cache
def get_ip_geodata(ip_address):
"""Use 3rd party API to obtain Geodata from a given IP."""
if cache.get(ip_address):
return cache.get(ip_address)
params = {}
r = requests.get(f"https://domain.com/{ip_address}", params=params)
r.raise_for_status()
cache.set(ip_address, r.json(), 60*60*24) # 24 hrs
return r.json()
The IP geodata handler must also be configured in your settings, using the IP_GEO_HANDLER
setting key. For example:
DEEP_LINK = {
'IP_GEO_HANDLER': 'my_project.my_app.utils.get_ip_geodata'
}
If not specified, the 'IP_GEO_HANDLER'
setting defaults to the geodata provided by Deep Link, which leverages IP Stack:
DEEP_LINK = {
'IP_GEO_HANDLER': 'django_deep_link.helpers.ip.get_ip_geodata'
}
Features
- TODO
Development
make env
make reqs
pip install -e .
Testing
Project is at 76% test coverage.
python3 runtests.py
python3 -m pytest -v
tox
# Run coverage
pytest --cov-report html --cov-report term --cov=tests/
Issues
If you experience any issues, please create an issue on Bitbucket.
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[0.3.0] - 2023-06-23
- New packaging method using
pyproject.toml
- Fresh migrations
- Moved
model_utils
tomixins.py
[0.2.6] - 2021-08-04
Fixed
- Added missing migrations.
[0.2.5] - 2021-07-29
Changed
- Removed print statement
- Moved
get_querystring_as_dict
intohelpers
[0.2.4] - 2021-07-29
Added
- Capture query params in visit
[0.2.3] - 2021-07-29
Changed
- Don't assume url pattern
[0.2.2] - 2021-07-29
Added
- Link to mobile and desktop app stores.
Fixed
- Broken app store links in app listing
[0.1.0] - 2021-07-23
- First release on PyPI.
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 Distributions
Built Distribution
Hashes for django_deep_link-0.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d04c2f7254be68219ab9656a5f3cadfdf20c0744ccc89a5038555590923bda4a |
|
MD5 | d27c497ab4a7ecb80a32410b13ccfeea |
|
BLAKE2b-256 | 5fc6c718d57e8acc8d08b60878cb28e038e7b417d269b3bb5d38e93374318615 |