<commit_before>.. _usage:

How To Use Formsender
=====================


In conf.py change the following variables to match your setup:

.. code-block:: python

    EMAIL = u'<EMAIL>'
    TOKN = u'1234567890-='
    CEILING = 10
    DUPL_CHECK_LIM = 3600

* ``EMAIL`` is where the form data will be sent.
* ``TOKN`` is the validating token from the form. This must match a hidden field
  in your form called 'tokn'.
* ``CEILING`` is the maximum number of submit requests formsender will accept
  per second.
* ``DUPL_CHECK_LIM`` is the time (in seconds) to check past form submissions for
  duplicate submissions.

You can run flake8 on request_handler (the application):

.. code-block:: none

    make flake


And tests can be run:

.. code-block:: none

    make tests

To run the application locally for development purposes:

.. code-block:: none

    make run

The app will now wait at ``localhost:5000`` for the form to be submitted, and
will email the information submitted to the email specified.

You can change the host and port Formsender waits at by modifying the run_simple
method at the bottom of request_handler.py. The first argument is the location
of the listener (set to ``127.0.0.1``, or ``localhost``), the second is the port
(set to ``5000``). These two arguments can be changed to match your desired
setup.
<commit_msg>Updated docs to reflect settings change<commit_after>.. _usage:

How To Use Formsender
=====================


In conf.py change the following variables to match your setup:

.. code-block:: python

    EMAIL = u'<EMAIL>'
    TOKN = u'1234567890-='
    CEILING = 10
    DUPLICATE_CHECK_TIME = 3600

* ``EMAIL`` is where the form data will be sent.
* ``TOKN`` is the validating token from the form. This must match a hidden field
  in your form called 'tokn'.
* ``CEILING`` is the maximum number of submit requests formsender will accept
  per second.
* ``DUPLICATE_CHECK_TIME`` is the time (in seconds) to check past form
  submissions for duplicate submissions.

You can run flake8 on request_handler (the application):

.. code-block:: none

    make flake


And tests can be run:

.. code-block:: none

    make tests

To run the application locally for development purposes:

.. code-block:: none

    make run

The app will now wait at ``localhost:5000`` for the form to be submitted, and
will email the information submitted to the email specified.

You can change the host and port Formsender waits at by modifying the run_simple
method at the bottom of request_handler.py. The first argument is the location
of the listener (set to ``127.0.0.1``, or ``localhost``), the second is the port
(set to ``5000``). These two arguments can be changed to match your desired
setup.

{'fraction_non_alphanumeric': 0.09331373989713446, 'fraction_numerical': 0.022777369581190303, 'mean_word_length': 3.7439024390243905, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '473154', 'n_tokens_mistral': 829, 'n_tokens_neox': 757, 'n_words': 385}