django-tawkto
django-tawkto is a simple Django app to it integrates with https://www.tawk.to/ chat.
Requirements
Python 3.7 to 3.10 supported.
Django 2.2 to 4.0 supported.
Quick start
Install the stable release from pypi (using pip):
pip install django-tawkto
Add tawkto to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [
...
'tawkto',
]
Add TAWKTO_ID_SITE in settings.py:
TAWKTO_ID_SITE='<tawkto id site>'
(Optional) Add TAWKTO_API_KEY:
TAWKTO_API_KEY='<tawkto api key>'
(Optional) For secure site (requires TAWKTO_API_KEY):
TAWKTO_IS_SECURE=True
In HTML:
{% load tawkto_tags %}
<!DOCTYPE html>
<html lang="en">
<head>
...
</head>
<body>
...
{% tawkto_script %}
</body>
</html>
(Optional) Add visitor name and email:
{% tawkto_script user_name=request.user.get_full_name user_email=request.user.email %}
(Optional) Use a different widget for a given property (default is the default value):
TAWKTO_WIDGET_ID = "default"
or
{% tawkto_script widget_id='somewidgetid' %}
(Optional) Use a different tawkto property:
{% tawkto_script id_site='tawktosideit' api_key='tawktoapikey'%}
(Optional) If you want to hide the chat for superuser (default is True):
TAWKTO_EXCLUDE_SUPERUSERS = True
(Optional) Set custom metadata regarding this chat/visitor:
is_securemust beTrue.- You must provide a valid email.
- Metadata is represented by key and value.
- The key is of the string data type and can contain only alphanumeric characters and ‘-‘ (dash).
- More in https://developer.tawk.to/jsapi/
setAttributessection.
# view.py
def view(request):
context = {'metadata': {'attr-1': 'value1', 'attr-2': 'value2'}}
return render(request, 'template.html', context)
In template:
{% tawkto_script is_secure=True user_email=example@example.com extra_attributes=metadata %}
Release files for django-tawkto 0.5.1
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-tawkto-0.5.1.tar.gz | 4.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_tawkto-0.5.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.1 kB
Release files / django-tawkto-0.5.1.tar.gz
| Download URL | django-tawkto-0.5.1.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78a340e96ff4546c8a4e4bb495afc87d9e6f93794f59d170673ee53ce3c009fb
|
|
BLAKE2b-256 checksum How to use checksums |
dae022a9fa23b0ef10a33bb4dbbefccd43f25c9e5bc1e563e44498c83d86a3f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
|
Release files / django_tawkto-0.5.1-py3-none-any.whl
| Download URL | django_tawkto-0.5.1-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8ef8204c1395fb4309038eb7aae8b8dd7e20e624a397fab691e89095077aea87
|
|
BLAKE2b-256 checksum How to use checksums |
82dc7a70fe6d3b2e656f5adaaef361dad0962fb13c695e4494f28ea97e11fdce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
|