Skip to main content

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

  1. Add to INSTALLED_APPS

    INSTALLED_APPS = [
        ...
        'djconnectwise',
        ...
    ]
    
  2. Add to urls.py:

    re_path(
        r'^callback/',  # This can be whatever you want.
        include('djconnectwise.urls', namespace='connectwise')
    ),
    
  3. 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 the api-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.

  4. Sync objects with this management command: cwsync. This will take a very long time if there are many objects to fetch.

  5. Register your callbacks with the management command: callbacks_registered

  6. Use standard Django model signals to see when objects change.

  7. 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

django-connectwise-0.3.197.tar.gz (301.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_connectwise-0.3.197-py3.8.egg (509.8 kB view details)

Uploaded Egg

File details

Details for the file django-connectwise-0.3.197.tar.gz.

File metadata

  • Download URL: django-connectwise-0.3.197.tar.gz
  • Upload date:
  • Size: 301.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for django-connectwise-0.3.197.tar.gz
Algorithm Hash digest
SHA256 4383d09a542b972afbb6bac14e3e559bf332b22962d75692949c0310fb310a3c
MD5 cb174e003d1f39c89f29ff326d0bd0e5
BLAKE2b-256 3fcb080e9b7ecac9b87f74a568e6def1ade4a69b8e0a741771b6b383f64f4adf

See more details on using hashes here.

File details

Details for the file django_connectwise-0.3.197-py3.8.egg.

File metadata

  • Download URL: django_connectwise-0.3.197-py3.8.egg
  • Upload date:
  • Size: 509.8 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for django_connectwise-0.3.197-py3.8.egg
Algorithm Hash digest
SHA256 078d445dc9dd241a626764cf0a8115d9fa97c635c9756c71694f0a7edb890627
MD5 d74eea05ef8dfd1a5bfda8760626a8bb
BLAKE2b-256 bdaeb9261ffe8c65dcd3171c8f965b9b84eee4154bba1cfda4f4a05f8246ca91

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page