Django app for working with ConnectWise. Defines models (tickets, members, companies, etc.) and callbacks.
Project description
django-connectwise
Django app for working with ConnectWise. Defines models (tickets, members, companies, etc.) and callbacks.
Requirements
- Python 3.5
- Django 2.0
Other versions may work; we haven't tried.
Installation
From PyPI:
pip install django-connectwise
From source:
git clone git@github.com:KerkhoffTechnologies/django-connectwise.git
cd django-connectwise
python setup.py install
Usage
-
Add to INSTALLED_APPS
INSTALLED_APPS = [ ... 'djconnectwise', ... ]
-
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_configuration
For ConnectWise Cloud users,
CONNECTWISE_SERVER_URL
can be just i.e.https://na.myconnectwise.net
- the library changes to theapi-region
domain automatically.The
DJCONNECTWISE_CONF_CALLABLE
function 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_test.txt
Try one of:
./runtests.py
python setup.py test
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.
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 Distribution
File details
Details for the file django-connectwise-0.3.139.tar.gz
.
File metadata
- Download URL: django-connectwise-0.3.139.tar.gz
- Upload date:
- Size: 282.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ed327caa3a45a90fcb6c5d55d4bf2f07f6a7e85ff16e49af9271b7ec92152b7 |
|
MD5 | f287af55e50cc43a6e3e1f7e0a04b9eb |
|
BLAKE2b-256 | 306834cfc9e47c3a9bebab93bf856f3cee99e2688e0ecce6b5a83a072ef70cb4 |