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',
        'easy_thumbnails'  # Used for managing user pictures
        ...
    ]
    
  2. 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
    

    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.

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

  4. Register your callbacks with these management commands:

    1. create_callback ticket
    2. create_callback project
    3. create_callback company
    4. create_callback opportunity
  5. Use standard Django model signals to see when objects change.

  6. To control how user avatar thumbnails are stored, add settings from easy-thumbnails.

To de-register your callbacks, use the delete_callback management command.

Testing

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.1.4a0.tar.gz (164.2 kB view details)

Uploaded Source

File details

Details for the file django-connectwise-0.1.4a0.tar.gz.

File metadata

File hashes

Hashes for django-connectwise-0.1.4a0.tar.gz
Algorithm Hash digest
SHA256 664c0f008d219787be48c023643617e55316090f488ef5392c7770875937e160
MD5 c6e6a1b42bbd9edf766338b31800de88
BLAKE2b-256 329adc6587e6dc52055339710cdb848b3f7e3504329c5cc8832d70b8cc29c365

See more details on using hashes here.

Supported by

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