django-connectwise
Django app for working with ConnectWise. Defines models (tickets, members, companies, etc.) and callbacks.
Requirements
- Python 3.12, 3.13 or 3.14
- Django 4.2, 5.2 or 6.0
Other versions may work; we haven't tried. Django 4.2 is only tested on Python 3.12, since that's the newest Python it supports.
The models define GinIndexes on their user-defined-field data, so PostgreSQL
is the expected database backend.
Installation
From PyPI:
pip install django-connectwise
From source:
git clone git@github.com:KerkhoffTechnologies/django-connectwise.git
cd django-connectwise
pip install -e .
Usage
-
Add to INSTALLED_APPS
INSTALLED_APPS = [ ... 'djconnectwise', 'django.contrib.postgres', # Required by the models' GinIndexes. ... ] -
Add to
urls.py:re_path( r'^callback/', # This can be whatever you want. include('djconnectwise.urls', namespace='connectwise') ), -
Add to settings:
CONNECTWISE_SERVER_URL = 'https://connectwise.example.com' CONNECTWISE_CREDENTIALS = { 'company_id': 'your company ID', 'api_public_key': 'your API user public key', 'api_private_key': 'your API user private key', } CONNECTWISE_TICKET_PATH = 'v4_6_release/services/system_io/router/openrecord.rails' def djconnectwise_configuration(): return { 'timeout': 30.0, # Network timeout in seconds 'batch_size': 50, # Number of records to fetch in each request 'max_attempts': 3, # Number of times to make a request before failing 'callback_url': '{}?id='.format( reverse('connectwise:callback') ), 'callback_host': '{}://{}'.format( 'http' if DEBUG else 'https', 'djconnectwise-host.example.com' ), } DJCONNECTWISE_CONF_CALLABLE = djconnectwise_configurationFor ConnectWise Cloud users,
CONNECTWISE_SERVER_URLcan be just i.e.https://na.myconnectwise.net- the library changes to theapi-regiondomain automatically.The
DJCONNECTWISE_CONF_CALLABLEfunction should return a dictionary with the fields shown above. It's a callable so that it can fetch settings at runtime- for example from Constance settings. -
Sync objects with this management command:
cwsync. This will take a very long time if there are many objects to fetch. -
Register your callbacks with the management command:
callbacks_registered -
Use standard Django model signals to see when objects change.
-
To control how user avatar thumbnails are stored, add settings from easy-thumbnails.
To de-register your callbacks, use the callbacks_deleted management command.
Testing
Prepare your environment:
pip install --upgrade -r requirements.txt
pip install --upgrade -r requirements_test.txt
pip install -e .
Try one of:
./runtests.py
make test
Contributing
-
Fork this repo
-
Make a branch
-
Make your improvements
Making migrations? Run:
./makemigrations.py -
Run the tests (see above)
-
Make a pull request
License
MIT
Copyright
© 2017 Kerkhoff Technologies Inc.
Metadata
Release files for django-connectwise 1.31.0
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_connectwise-1.31.0.tar.gz | 145.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_connectwise-1.31.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 401.1 kB
Release files / django_connectwise-1.31.0.tar.gz
| Download URL | django_connectwise-1.31.0.tar.gz |
|---|---|
| Size | 145.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
579cc952a917f2a5077abbe1bf2dcf50161fec7fdca048a699046a65ce7ad2b0
|
|
BLAKE2b-256 checksum How to use checksums |
dc006d430fa6e9e02813cedf02016cd149d353329562d09127431fc051b3ba6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / django_connectwise-1.31.0-py3-none-any.whl
| Download URL | django_connectwise-1.31.0-py3-none-any.whl |
|---|---|
| Size | 255.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0efc20d9a2ba9192878ae9326776d448e7c7166713fd7be711f16e408d940f41
|
|
BLAKE2b-256 checksum How to use checksums |
532d5498921c925cc3e6b5c988415b54c517397a18b5d1459464779cf1b9c6c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|