<commit_before>============
django-asana
============

:License: MIT

django-asana leverages python-asana, the official python client library for Asana. To this, django-asana adds
django models and commands for importing data from Asana into these models.

Detailed documentation is in the "docs" directory.

About
=====

``django-asana`` aims to allow for rich interaction between Django projects and Asana projects. The vision is to allow automated processes done in Django to interact with human Asana users toward project completion. For example, an Asana project might include a workflow of ten tasks that must all be completed in order. This tool will monitor the Asana project status, complete the automated steps when they are ready to be done, and report completion bask to Asana so the workflow may continue.

For now, this tool can do a one time sync from Asana, storing the current status of workspaces, projects, and tasks in Django models. Depending on the size of the Asana workspaces, this initial sync may take some time. Successive syncs are faster if they are performed within the hour, which is the timeout for Asana's sync token. Webhook receivers are registered so the Django project will remain synced to Asana in real-time. Task.sync_to_asana() can be used to update Asana to reflect local changes, like task completion.


Requirements
============

#. Python 3+
#. `Django 1.8+ <https://www.djangoproject.com/>`_
#. `python-asana 0.6.2+ <https://github.com/Asana/python-asana>`_
#. `django-braces 1.10+ <https://django-braces.readthedocs.io/en/latest/index.html>`_ for JsonRequestResponseMixin


Installation
============

This will also install `python-asana <https://github.com/Asana/python-asana>`_.

 $ pip install django-asana

Quick start
===========

#. Configure your django settings file. Asana allows two different connection methods. For Oauth2, provide values for the following settings: ASANA_CLIENT_ID, ASANA_CLIENT_SECRET, and ASANA_OAUTH_REDIRECT_URI. To use an access token, provide a value for ASANA_ACCESS_TOKEN. Then add "django-asana" to your INSTALLED_APPS setting like this::

    INSTALLED_APPS = [
        ...
        'djasana',
    ]

If you have multiple Asana workspaces but only ever need to sync one with Django, specify it:

    ASANA_WORKSPACE = 'This Workspace'

In the production version of your settings, set a base url for the webhooks. It must be reachable by Asana and secured by SSL. In your dev environment it is fine to leave this setting out; your project will be synced whenever you run the management command.

    DJASANA_WEBHOOK_URL = 'https://mysite.com/djasana/webhooks'

With that value, your webhook urls will be something like this: https://mysite.com/djasana/webhooks/project/1337/


#. To enable webhooks so Asana can keep your data in sync, add the following to your base urls.py

    urlpatterns += [
        url(r'^', include('djasana.urls')),
    ]<commit_msg>Improves instructions for webhook settings<commit_after>============
django-asana
============

:License: MIT

django-asana leverages python-asana, the official python client library for Asana. To this, django-asana adds
django models and commands for importing data from Asana into these models.

Detailed documentation is in the "docs" directory.

About
=====

``django-asana`` aims to allow for rich interaction between Django projects and Asana projects. The vision is to allow automated processes done in Django to interact with human Asana users toward project completion. For example, an Asana project might include a workflow of ten tasks that must all be completed in order. This tool will monitor the Asana project status, complete the automated steps when they are ready to be done, and report completion bask to Asana so the workflow may continue.

For now, this tool can do a one time sync from Asana, storing the current status of workspaces, projects, and tasks in Django models. Depending on the size of the Asana workspaces, this initial sync may take some time. Successive syncs are faster if they are performed within the hour, which is the timeout for Asana's sync token. Webhook receivers are registered so the Django project will remain synced to Asana in real-time. Task.sync_to_asana() can be used to update Asana to reflect local changes, like task completion.


Requirements
============

#. Python 3+
#. `Django 1.8+ <https://www.djangoproject.com/>`_
#. `python-asana 0.6.2+ <https://github.com/Asana/python-asana>`_
#. `django-braces 1.10+ <https://django-braces.readthedocs.io/en/latest/index.html>`_ for JsonRequestResponseMixin


Installation
============

This will also install `python-asana <https://github.com/Asana/python-asana>`_.

 $ pip install django-asana

Quick start
===========

#. Configure your django settings file. Asana allows two different connection methods. For Oauth2, provide values for the following settings: ASANA_CLIENT_ID, ASANA_CLIENT_SECRET, and ASANA_OAUTH_REDIRECT_URI. To use an access token, provide a value for ASANA_ACCESS_TOKEN. Then add "django-asana" to your INSTALLED_APPS setting like this::

    INSTALLED_APPS = [
        ...
        'djasana',
    ]

If you have multiple Asana workspaces but only ever need to sync one with Django, specify it:

    ASANA_WORKSPACE = 'This Workspace'

In the production version of your settings, set a base url and pattern for the webhooks. It must be reachable by Asana and secured by SSL. In your dev environment it is fine to leave this setting out; your project will be synced whenever you run the management command.

    DJASANA_WEBHOOK_URL = 'https://mysite.com/djasana/webhooks'
    DJASANA_WEBHOOK_PATTERN = r'^djasana/webhooks/'

With that value, your webhook urls will be something like this: https://mysite.com/djasana/webhooks/project/1337/


#. To enable webhooks so Asana can keep your data in sync, add the following to your base urls.py

    urlpatterns += [
        url(settings.DJASANA_WEBHOOK_PATTERN, include('djasana.urls')),
    ]
{'fraction_non_alphanumeric': 0.0845961698584513, 'fraction_numerical': 0.00466278101582015, 'mean_word_length': 4.310344827586207, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 12, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6379305', 'n_tokens_mistral': 1735, 'n_tokens_neox': 1645, 'n_words': 764}