<commit_before>===================
Configuring PyBossa
===================

The PyBossa `settings_local.py.tmpl`_ file has all the available configuration
options for your server. This section, explains each of them and how you
should/could use them in your server.

.. _`settings_local.py.tmpl`: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl

Debug mode
==========

The DEBUG_ mode is disabled by default in the configuration file, as this should
be only used when you are running the server for development purposes. You
should not enable this option, unless you need to do some debugging in the
PyBossa server

.. _DEBUG: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L1

.. note::
    For further details about the DEBUG mode in the PyBossa server, please,
    check the official documentation_.

.. _documentation: http://flask.pocoo.org/docs/quickstart/#debug-mode

Host and Port
=============

The HOST_ and PORT_ config variables can be used to force the server to listen
in specific addresses of your server, as well as at a given port. Usually, you
will only need to uncomment the HOST_ variable in order to listen in all the
net interfaces.

.. _HOST: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L4
.. _PORT: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L5

Securing the server
===================

PyBossa uses the `Flask Sessions`_ feature that signs the cookies
cryptographically for storing information. This improves the security of the
server, as the user could look at the contents of the cookie but not modify it,
unless they know the SECRET_ and SECRET_KEY_.

Therefore, **it is very important that you create a new SECRET and SECRET_KEY
keys for your server and keep them private**. Please, check the `Flask
Sessions`_ documentation for instructions about how to create good secret keys.

.. _`Flask Sessions`: http://flask.pocoo.org/docs/quickstart/#sessions

.. _SECRET: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L7
.. _SECRET_KEY : https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L8

Database username and password
==============================

PyBossa uses the SQLAlchemy_ SQL toolkit to access the DB. In the settings
file, you only need to modify the name of the user, password and database name
so it fits your needs in the field `SQLALCHEMY_DATABASE_URI`_::
    
    'postgresql://username:userpassword@localhost/databasename'
    
.. _`SQLALCHEMY_DATABSE_URI`: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L10
.. _SQLAlchemy: http://www.sqlalchemy.org/

It's dangerous, so better sign this
===================================

PyBossa uses the `It's dangerous` Python library that allows you to send some
data to untrusted environments, but signing it. Basically, it uses a key that
the server only knows and uses it for signing the data. 

This library is used to send the recovery password e-mails to your PyBossa
users, sending a link with a signed key that will be verified in the server.
Thus, **it is very important you create a secure and private key for the it's
dangerous module in your configuration file**, just modify the
ITSDANGEROUSKEY_.

.. _ITSDANGEROUSKEY: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L12
.. _`It's dangerous`: http://pythonhosted.org/itsdangerous/

Modifying the Brand name
========================

You can configure your project with a different name, instead of the default
one: PyBossa. You only need to change the string BRAND_ to the name of your
organization or project.

.. _BRAND: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L15

Adding a Logo
=============

By default, PyBossa does not provide a logo for the server side, so you will
have to copy your logo into the folder: **pybossa/pybossa/static/img**. If the
logo name is, **my_brand.png** the LOGO_ variable should be updated with the
name of the file.

.. _LOGO: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L17

Terms of Use
============

You can change and modify the TERMSOFUSE_ for your server, by overriding the
provided URL that we use by default. You can also modify the license used for
the data, just change the DATAUSE_ link to the open license that you want to
use.

.. _TERMSOFUSE: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L20
.. _DATEUSE: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L21


Enabling Twitter, Facebook and Google authentication
====================================================

PyBossa supports third party authentication services like Twitter, Facebook and
Google.

Twitter
~~~~~~~

If you want to enable Twitter, you will need to create an application in
Twitter_ and copy and paste the **Consumer key and secret** into the next
variables: `TWITTER_CONSUMER_KEY`_ and `TWITTER_CONSUMER_SECRET`_ and uncomment
them.<commit_msg>Add documentation about how to configure email and twitter contact info<commit_after>===================
Configuring PyBossa
===================

The PyBossa `settings_local.py.tmpl`_ file has all the available configuration
options for your server. This section, explains each of them and how you
should/could use them in your server.

.. _`settings_local.py.tmpl`: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl

Debug mode
==========

The DEBUG_ mode is disabled by default in the configuration file, as this should
be only used when you are running the server for development purposes. You
should not enable this option, unless you need to do some debugging in the
PyBossa server

.. _DEBUG: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L1

.. note::
    For further details about the DEBUG mode in the PyBossa server, please,
    check the official documentation_.

.. _documentation: http://flask.pocoo.org/docs/quickstart/#debug-mode

Host and Port
=============

The HOST_ and PORT_ config variables can be used to force the server to listen
in specific addresses of your server, as well as at a given port. Usually, you
will only need to uncomment the HOST_ variable in order to listen in all the
net interfaces.

.. _HOST: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L4
.. _PORT: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L5

Securing the server
===================

PyBossa uses the `Flask Sessions`_ feature that signs the cookies
cryptographically for storing information. This improves the security of the
server, as the user could look at the contents of the cookie but not modify it,
unless they know the SECRET_ and SECRET_KEY_.

Therefore, **it is very important that you create a new SECRET and SECRET_KEY
keys for your server and keep them private**. Please, check the `Flask
Sessions`_ documentation for instructions about how to create good secret keys.

.. _`Flask Sessions`: http://flask.pocoo.org/docs/quickstart/#sessions

.. _SECRET: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L7
.. _SECRET_KEY : https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L8

Database username and password
==============================

PyBossa uses the SQLAlchemy_ SQL toolkit to access the DB. In the settings
file, you only need to modify the name of the user, password and database name
so it fits your needs in the field `SQLALCHEMY_DATABASE_URI`_::
    
    'postgresql://username:userpassword@localhost/databasename'
    
.. _`SQLALCHEMY_DATABSE_URI`: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L10
.. _SQLAlchemy: http://www.sqlalchemy.org/

It's dangerous, so better sign this
===================================

PyBossa uses the `It's dangerous` Python library that allows you to send some
data to untrusted environments, but signing it. Basically, it uses a key that
the server only knows and uses it for signing the data. 

This library is used to send the recovery password e-mails to your PyBossa
users, sending a link with a signed key that will be verified in the server.
Thus, **it is very important you create a secure and private key for the it's
dangerous module in your configuration file**, just modify the
ITSDANGEROUSKEY_.

.. _ITSDANGEROUSKEY: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L12
.. _`It's dangerous`: http://pythonhosted.org/itsdangerous/

Modifying the Brand name
========================

You can configure your project with a different name, instead of the default
one: PyBossa. You only need to change the string BRAND_ to the name of your
organization or project.

.. _BRAND: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L15

Adding a Logo
=============

By default, PyBossa does not provide a logo for the server side, so you will
have to copy your logo into the folder: **pybossa/pybossa/static/img**. If the
logo name is, **my_brand.png** the LOGO_ variable should be updated with the
name of the file.

.. _LOGO: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L17

Adding your Contact Information
===============================

By default, PyBossa provides an e-mail and a Twitter handle to contact the
PyBossa infrastructure. If you want, you can change it to your own e-mail and
Twitter account. You can do it, modifying the following variables in the
**settings_local.py** file:

* **CONTACT_EMAIL** = '<EMAIL>'
* **CONTACT_TWITTER** = 'yourtwitterhandle'

Terms of Use
============

You can change and modify the TERMSOFUSE_ for your server, by overriding the
provided URL that we use by default. You can also modify the license used for
the data, just change the DATAUSE_ link to the open license that you want to
use.

.. _TERMSOFUSE: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L20
.. _DATEUSE: https://github.com/PyBossa/pybossa/blob/master/settings_local.py.tmpl#L21


Enabling Twitter, Facebook and Google authentication
====================================================

PyBossa supports third party authentication services like Twitter, Facebook and
Google.

Twitter
~~~~~~~

If you want to enable Twitter, you will need to create an application in
Twitter_ and copy and paste the **Consumer key and secret** into the next
variables: `TWITTER_CONSUMER_KEY`_ and `TWITTER_CONSUMER_SECRET`_ and uncomment
them.
{'fraction_non_alphanumeric': 0.12113673332695436, 'fraction_numerical': 0.0032532771983542243, 'mean_word_length': 4.720853858784893, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 24, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7087248', 'n_tokens_mistral': 3204, 'n_tokens_neox': 2987, 'n_words': 1210}