<commit_before>FAQ
==============

This page contains a few recipes on how to use DataCats to easily accomplish
common CKAN tasks. We're always looking for more. If you have examples of your
own you wish to share, please submit a pull request.

Run an interactive Paster Shell
-------------------------------
Anywhere within your datacats environment directory, run::

    datacats shell . paster --plugin=pylons shell

Run Celery tasks
----------------
If you have an extension that is using Celery, make sure that the extension is
installed in your environment with ``datacats install``. You can then run a
container with a celery daemon like this: ::

    datacats paster celeryd

Cleaning the database doesn't work.
-----------------------------------
When running the command ``paster db clean``, the command will freeze as it is
blocked from cleaning the database if CKAN is connected to the db (`see issue`_)
. To get around this, stop the ``web`` docker container for your environment
first, then issue the command, and reload datacats: ::

    docker stop datacats_web_myckan
    datacats paster db clean
    datacats reload

.. _see issue: https://github.com/ckan/ckan/issues/2306

InsecurePlatformWarning
-----------------------
If you get an ``InsecurePlatformWarning``, this is an issue with the ``urllib3``
library - `more info here`_. If you'd like to make it go away, you can run the
following: ::

    pip install pyopenssl ndg-httpsclient pyasn1

.. _more info here: https://urllib3.readthedocs.org/en/latest/security.html

Working on Core CKAN
--------------------
If you plan on working on core CKAN code, you should first ``unshallow`` your
copy of the CKAN source. By default datacats only checks out a shallow copy of
the CKAN github repo. This can cause minor headaches if you are planning on
contributing your code changes to core CKAN.

In the ``/ckan`` directory of your datacats environment, run the following git
command: ::

    git fetch --unshallow

boot2docker - Upgrading or Recovering from failures<commit_msg>docs update<commit_after>FAQ
==============

This page contains a few recipes on how to use DataCats to easily accomplish
common CKAN tasks. We're always looking for more. If you have examples of your
own you wish to share, please submit a pull request.

Run an interactive Paster Shell
-------------------------------
Anywhere within your datacats environment directory, run::

    datacats shell . paster --plugin=pylons shell

Run Celery tasks
----------------
If you have an extension that is using Celery, make sure that the extension is
installed in your environment with ``datacats install``. You can then run a
container with a celery daemon like this: ::

    datacats paster celeryd

Cleaning the database doesn't work.
-----------------------------------
When running the command ``paster db clean``, the command will freeze as it is
blocked from cleaning the database if CKAN is connected to the db (`see issue`_)
. To get around this, stop the ``web`` docker container for your environment
first, then issue the command, and reload datacats: ::

    docker stop datacats_web_myckan
    datacats paster db clean
    datacats reload

.. _see issue: https://github.com/ckan/ckan/issues/2306

InsecurePlatformWarning
-----------------------
If you get an ``InsecurePlatformWarning``, this is an issue with the ``urllib3``
library - `more info here`_. If you'd like to make it go away, you can run the
following_: ::

    pip install pyopenssl ndg-httpsclient pyasn1

.. _more info here: https://urllib3.readthedocs.org/en/latest/security.html
.. _following: https://urllib3.readthedocs.org/en/latest/security.html#pyopenssl

Working on Core CKAN
--------------------
If you plan on working on core CKAN code, you should first ``unshallow`` your
copy of the CKAN source. By default datacats only checks out a shallow copy of
the CKAN github repo. This can cause minor headaches if you are planning on
contributing your code changes to core CKAN.

In the ``/ckan`` directory of your datacats environment, run the following git
command: ::

    git fetch --unshallow

boot2docker - Upgrading or Recovering from failures
{'fraction_non_alphanumeric': 0.12158273381294964, 'fraction_numerical': 0.00407673860911271, 'mean_word_length': 3.1337958374628343, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, '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': '6557807', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1088, 'n_words': 554}