<commit_before>import os

from configurations import Configuration, values
from boto.s3.connection import OrdinaryCallingFormat


class Common(Configuration):
    BASE_DIR = os.path.dirname(os.path.dirname(__file__))

    ENVIRONMENT = values.Value(environ_prefix=None, default='development')

    APPNAME = 'horas'

    DEBUG = False

    TEMPLATE_DEBUG = DEBUG

    SECRET_KEY = values.SecretValue(environ_prefix=None)
    SSO_SECRET_KEY = values.SecretValue(environ_prefix=None)

    DISCOURSE_SSO_REDIRECT_URL = 'http://comunidad.1hora.org/session/sso_login?'

    ALLOWED_HOSTS = ['localhost', 'unahora.herokuapp.com']

    SITE_ID = 1

    DATE_FORMAT = 'D, F j, Y'

    # Application definition
    INSTALLED_APPS = (
        'django.contrib.admin',
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.messages',
        'django.contrib.staticfiles',
        'django.contrib.sites',

        # Third-party
        'south',
        'django_extensions',
        'allauth',
        'allauth.account',
        'allauth.socialaccount',
        'allauth.socialaccount.providers.twitter',
        'allauth.socialaccount.providers.facebook',
        'allauth.socialaccount.providers.google',
        'allauth.socialaccount.providers.persona',
        'taggit',
        'notification',
        'gunicorn',
        'storages',
        'collectfast',
        'djangosecure',
        'bootstrap3',

        # Local apps
        'apps.core',
        'apps.profiles',
        'apps.search',
        'apps.meetings',
        'apps.sso',
    )

    MIDDLEWARE_CLASSES = (
        'djangosecure.middleware.SecurityMiddleware',
        'django.contrib.sessions.middleware.SessionMiddleware',
        'django.middleware.common.CommonMiddleware',
        'django.middleware.csrf.CsrfViewMiddleware',
        'django.contrib.auth.middleware.AuthenticationMiddleware',
        'django.contrib.messages.middleware.MessageMiddleware',
        'django.middleware.clickjacking.XFrameOptionsMiddleware',
        'apps.core.middleware.TimezoneMiddleware',
        'apps.core.middleware.EnsureCompleteProfileMiddleware',
    )

    TEMPLATE_CONTEXT_PROCESSORS = (
        'django.contrib.auth.context_processors.auth',
        'django.core.context_processors.debug',
        'django.core.context_processors.i18n',
        'django.core.context_processors.media',
        'django.core.context_processors.static',
        'django.core.context_processors.tz',
        'django.contrib.messages.context_processors.messages',
        'django.core.context_processors.request',

        'allauth.account.context_processors.account',
        'allauth.socialaccount.context_processors.socialaccount',
    )

    TEMPLATE_DIRS = (
        os.path.join(BASE_DIR, 'templates'),
    )

    AUTHENTICATION_BACKENDS = (
        'django.contrib.auth.backends.ModelBackend',
        'allauth.account.auth_backends.AuthenticationBackend'
    )

    # Custom user model
    AUTH_USER_MODEL = 'profiles.User'
    LOGIN_URL = '/accounts/login/'

    # allauth settings
    ACCOUNT_ADAPTER = 'apps.profiles.adapters.AccountAdapter'
    ACCOUNT_DEFAULT_HTTP_PROTOCOL = 'https'
    ACCOUNT_EMAIL_SUBJECT_PREFIX = '[Horas] '
    ACCOUNT_LOGOUT_ON_GET = True
    ACCOUNT_EMAIL_REQUIRED = True
    ACCOUNT_SIGNUP_PASSWORD_VERIFICATION = False
    ACCOUNT_CONFIRM_EMAIL_ON_GET = True
    ACCOUNT_LOGOUT_REDIRECT_URL = LOGIN_URL
    ACCOUNT_USERNAME_BLACKLIST = ['admin']
    ACCOUNT_SIGNUP_FORM_CLASS = 'apps.profiles.forms.SignupForm'

    ROOT_URLCONF = 'horas.urls'

    WSGI_APPLICATION = 'horas.wsgi.application'

    # Database
    # https://docs.djangoproject.com/en/dev/ref/settings/#databases
    DATABASES = values.DatabaseURLValue(
        'sqlite:///{}'.format(os.path.join(BASE_DIR, 'db.sqlite3')))

    # Internationalization
    # https://docs.djangoproject.com/en/dev/topics/i18n/
    LANGUAGE_CODE = 'en-us'

    TIME_ZONE = 'UTC'
    HORAS_DEFAULT_TZ = os.environ.get('HORAS_DEFAULT_TZ')

    USE_I18N = True

    USE_L10N = True

    USE_TZ = True

    # Static files (CSS, JavaScript, Images)
    # https://docs.djangoproject.com/en/dev/howto/static-files/
    BRUNCH_DIR = os.path.join(BASE_DIR, 'static', 'src')

    DEFAULT_FILE_STORAGE = 'storages.backends.s3.S3Storage'

    AWS_PRELOAD_METADATA = True
    AWS_ACCESS_KEY_ID = values.Value(environ_prefix=None)
    AWS_SECRET_ACCESS_KEY = values.Value(environ_prefix=None)
    AWS_STORAGE_BUCKET_NAME = values.Value(environ_prefix=None)
    AWS_S3_CALLING_FORMAT = OrdinaryCallingFormat()
    AWS_QUERYSTRING_AUTH = False

    STATIC_URL = '/static/dist/'
<commit_msg>Remove ordinary calling format<commit_after>import os

from configurations import Configuration, values


class Common(Configuration):
    BASE_DIR = os.path.dirname(os.path.dirname(__file__))

    ENVIRONMENT = values.Value(environ_prefix=None, default='development')

    APPNAME = 'horas'

    DEBUG = False

    TEMPLATE_DEBUG = DEBUG

    SECRET_KEY = values.SecretValue(environ_prefix=None)
    SSO_SECRET_KEY = values.SecretValue(environ_prefix=None)

    DISCOURSE_SSO_REDIRECT_URL = 'http://comunidad.1hora.org/session/sso_login?'

    ALLOWED_HOSTS = ['localhost', 'unahora.herokuapp.com']

    SITE_ID = 1

    DATE_FORMAT = 'D, F j, Y'

    # Application definition
    INSTALLED_APPS = (
        'django.contrib.admin',
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.messages',
        'django.contrib.staticfiles',
        'django.contrib.sites',

        # Third-party
        'south',
        'django_extensions',
        'allauth',
        'allauth.account',
        'allauth.socialaccount',
        'allauth.socialaccount.providers.twitter',
        'allauth.socialaccount.providers.facebook',
        'allauth.socialaccount.providers.google',
        'allauth.socialaccount.providers.persona',
        'taggit',
        'notification',
        'gunicorn',
        'storages',
        'collectfast',
        'djangosecure',
        'bootstrap3',

        # Local apps
        'apps.core',
        'apps.profiles',
        'apps.search',
        'apps.meetings',
        'apps.sso',
    )

    MIDDLEWARE_CLASSES = (
        'djangosecure.middleware.SecurityMiddleware',
        'django.contrib.sessions.middleware.SessionMiddleware',
        'django.middleware.common.CommonMiddleware',
        'django.middleware.csrf.CsrfViewMiddleware',
        'django.contrib.auth.middleware.AuthenticationMiddleware',
        'django.contrib.messages.middleware.MessageMiddleware',
        'django.middleware.clickjacking.XFrameOptionsMiddleware',
        'apps.core.middleware.TimezoneMiddleware',
        'apps.core.middleware.EnsureCompleteProfileMiddleware',
    )

    TEMPLATE_CONTEXT_PROCESSORS = (
        'django.contrib.auth.context_processors.auth',
        'django.core.context_processors.debug',
        'django.core.context_processors.i18n',
        'django.core.context_processors.media',
        'django.core.context_processors.static',
        'django.core.context_processors.tz',
        'django.contrib.messages.context_processors.messages',
        'django.core.context_processors.request',

        'allauth.account.context_processors.account',
        'allauth.socialaccount.context_processors.socialaccount',
    )

    TEMPLATE_DIRS = (
        os.path.join(BASE_DIR, 'templates'),
    )

    AUTHENTICATION_BACKENDS = (
        'django.contrib.auth.backends.ModelBackend',
        'allauth.account.auth_backends.AuthenticationBackend'
    )

    # Custom user model
    AUTH_USER_MODEL = 'profiles.User'
    LOGIN_URL = '/accounts/login/'

    # allauth settings
    ACCOUNT_ADAPTER = 'apps.profiles.adapters.AccountAdapter'
    ACCOUNT_DEFAULT_HTTP_PROTOCOL = 'https'
    ACCOUNT_EMAIL_SUBJECT_PREFIX = '[Horas] '
    ACCOUNT_LOGOUT_ON_GET = True
    ACCOUNT_EMAIL_REQUIRED = True
    ACCOUNT_SIGNUP_PASSWORD_VERIFICATION = False
    ACCOUNT_CONFIRM_EMAIL_ON_GET = True
    ACCOUNT_LOGOUT_REDIRECT_URL = LOGIN_URL
    ACCOUNT_USERNAME_BLACKLIST = ['admin']
    ACCOUNT_SIGNUP_FORM_CLASS = 'apps.profiles.forms.SignupForm'

    ROOT_URLCONF = 'horas.urls'

    WSGI_APPLICATION = 'horas.wsgi.application'

    # Database
    # https://docs.djangoproject.com/en/dev/ref/settings/#databases
    DATABASES = values.DatabaseURLValue(
        'sqlite:///{}'.format(os.path.join(BASE_DIR, 'db.sqlite3')))

    # Internationalization
    # https://docs.djangoproject.com/en/dev/topics/i18n/
    LANGUAGE_CODE = 'en-us'

    TIME_ZONE = 'UTC'
    HORAS_DEFAULT_TZ = os.environ.get('HORAS_DEFAULT_TZ')

    USE_I18N = True

    USE_L10N = True

    USE_TZ = True

    # Static files (CSS, JavaScript, Images)
    # https://docs.djangoproject.com/en/dev/howto/static-files/
    BRUNCH_DIR = os.path.join(BASE_DIR, 'static', 'src')

    DEFAULT_FILE_STORAGE = 'storages.backends.s3.S3Storage'

    AWS_PRELOAD_METADATA = True
    AWS_ACCESS_KEY_ID = values.Value(environ_prefix=None)
    AWS_SECRET_ACCESS_KEY = values.Value(environ_prefix=None)
    AWS_STORAGE_BUCKET_NAME = values.Value(environ_prefix=None)
    AWS_QUERYSTRING_AUTH = False

    STATIC_URL = '/static/dist/'

{'fraction_non_alphanumeric': 0.11169982698961937, 'fraction_numerical': 0.0032439446366782005, 'mean_word_length': 3.1088405153265217, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, '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': '574802', 'n_tokens_mistral': 3117, 'n_tokens_neox': 3031, 'n_words': 357}