<commit_before>.. _config:

Configuration 
=============
Generally Eve configuration is best done with configuration files. The
configuration files themselves are actual Python files. 

Configuration with Files
------------------------
On startup, Eve will look for a `settings.py` file in the application folder.
You can choose an alternative filename/path. Just pass it as an argument when
you instantiate the application.

.. code-block:: python
    
    from eve import Eve

    app = Eve(settings='my_settings.py')
    app.run()

Configuration with a Dictionary
-------------------------------
Alternatively, you can choose to provide a settings dictionary:

.. code-block:: python
    
    my_settings = {
        'MONGO_HOST': 'localhost',
        'MONGO_PORT': 27017,
        'MONGO_DBNAME': 'the_db_name'
        'DOMAIN': {'contacts': {}} 
    }

    from eve import Eve
<commit_msg>Code snippet fix.<commit_after>.. _config:

Configuration 
=============
Generally Eve configuration is best done with configuration files. The
configuration files themselves are actual Python files. 

Configuration with Files
------------------------
On startup, Eve will look for a `settings.py` file in the application folder.
You can choose an alternative filename/path. Just pass it as an argument when
you instantiate the application.

.. code-block:: python
    
    from eve import Eve

    app = Eve(settings='my_settings.py')
    app.run()

Configuration with a Dictionary
-------------------------------
Alternatively, you can choose to provide a settings dictionary:

.. code-block:: python
    
    my_settings = {
        'MONGO_HOST': 'localhost',
        'MONGO_PORT': 27017,
        'MONGO_DBNAME': 'the_db_name',
        'DOMAIN': {'contacts': {}} 
    }

    from eve import Eve

{'fraction_non_alphanumeric': 0.1507537688442211, 'fraction_numerical': 0.005583472920156337, 'mean_word_length': 2.584, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '1495285', 'n_tokens_mistral': 486, 'n_tokens_neox': 448, 'n_words': 182}