<commit_before>from django.conf import settings
from pydoc import locate

# The 'correct' configuration for Explorer looks like:

# EXPLORER_CONNECTIONS = {
#   'Original Database': 'my_important_database_readonly_connection',
#   'Client Database 2': 'other_database_connection'
# }
# EXPLORER_DEFAULT_CONNECTION = 'my_important_database_readonly_connection'

EXPLORER_CONNECTIONS = getattr(settings, 'EXPLORER_CONNECTIONS', {})
EXPLORER_DEFAULT_CONNECTION = getattr(
    settings, 'EXPLORER_DEFAULT_CONNECTION', None
)

# Change the behavior of explorer
EXPLORER_SQL_BLACKLIST = getattr(
    settings, 'EXPLORER_SQL_BLACKLIST',
    (
        'ALTER',
        'RENAME ',
        'DROP',
        'TRUNCATE',
        'INSERT INTO',
        'UPDATE',
        'REPLACE',
        'DELETE',<commit_msg>Fixes Security hole in blacklist for MySQL #490 (#494)<commit_after>from django.conf import settings
from pydoc import locate

# The 'correct' configuration for Explorer looks like:

# EXPLORER_CONNECTIONS = {
#   'Original Database': 'my_important_database_readonly_connection',
#   'Client Database 2': 'other_database_connection'
# }
# EXPLORER_DEFAULT_CONNECTION = 'my_important_database_readonly_connection'

EXPLORER_CONNECTIONS = getattr(settings, 'EXPLORER_CONNECTIONS', {})
EXPLORER_DEFAULT_CONNECTION = getattr(
    settings, 'EXPLORER_DEFAULT_CONNECTION', None
)

# Change the behavior of explorer
EXPLORER_SQL_BLACKLIST = getattr(
    settings, 'EXPLORER_SQL_BLACKLIST',
    (
        'ALTER',
        'RENAME ',
        'DROP',
        'TRUNCATE',
        'INSERT',
        'UPDATE',
        'REPLACE',
        'DELETE',
{'fraction_non_alphanumeric': 0.09815950920245399, 'fraction_numerical': 0.0049079754601227, 'mean_word_length': 4.194267515923567, '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': '1647497', 'n_tokens_mistral': 542, 'n_tokens_neox': 515, 'n_words': 108}