<commit_before>"""
Django settings for scifight project.

Generated by 'django-admin startproject' using Django 1.9.7.

For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""

import os
import logging
from .settings_secret import *

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

LOG_PATH = os.path.join(BASE_DIR, 'scifight.log')
logging.basicConfig(format='%(filename)s[LINE:%(lineno)d]# '
                           '%(levelname)-8s [%(asctime)s]  %(message)s',
                    level=logging.DEBUG,
                    filename=LOG_PATH)

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'scifight',
    'admin_reorder',
]

MIDDLEWARE_CLASSES = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'admin_reorder.middleware.ModelAdminReorder'
]

ROOT_URLCONF = 'scifight_proj.urls'

WSGI_APPLICATION = 'scifight_proj.wsgi.application'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]


# Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [{"NAME": validator} for validator in [
    'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    'django.contrib.auth.password_validation.MinimumLengthValidator',
    'django.contrib.auth.password_validation.CommonPasswordValidator',
    'django.contrib.auth.password_validation.NumericPasswordValidator']]

# Internationalization
# https://docs.djangoproject.com/en/1.9/topics/i18n/

LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static_files')

# === Settings for 'admin-reorder' extension ===

ADMIN_REORDER = ('sites',
    dict(app='scifight',
         label='Tournament preparation',
         models=[
             'scifight.Tournament',
             'scifight.TournamentRound',
             'scifight.Team',
             'scifight.Participant',
             'scifight.Leader',
             'scifight.Room',
             'scifight.Problem',
             'scifight.Juror',
             'scifight.TeamOrigin',
             'scifight.PersonOrigin']),

    dict(app='scifight',
         label='Tournament progress',
         models=[
             'scifight.Fight',
             'scifight.FightStage']),

    dict(app='auth',
         label='Website administration',
         models=[
             'auth.User',
             'auth.Group']))<commit_msg>scifight_proj/settings.py: import local config at the bottom of file<commit_after>"""
Django settings for scifight project.

Generated by 'django-admin startproject' using Django 1.9.7.

For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""

import os
import logging

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

LOG_PATH = os.path.join(BASE_DIR, 'scifight.log')
logging.basicConfig(format='%(filename)s[LINE:%(lineno)d]# '
                           '%(levelname)-8s [%(asctime)s]  %(message)s',
                    level=logging.DEBUG,
                    filename=LOG_PATH)

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'scifight',
    'admin_reorder',
]

MIDDLEWARE_CLASSES = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'admin_reorder.middleware.ModelAdminReorder'
]

ROOT_URLCONF = 'scifight_proj.urls'

WSGI_APPLICATION = 'scifight_proj.wsgi.application'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]


# Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [{"NAME": validator} for validator in [
    'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    'django.contrib.auth.password_validation.MinimumLengthValidator',
    'django.contrib.auth.password_validation.CommonPasswordValidator',
    'django.contrib.auth.password_validation.NumericPasswordValidator']]

# Internationalization
# https://docs.djangoproject.com/en/1.9/topics/i18n/

LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static_files')

# === Settings for 'admin-reorder' extension ===

ADMIN_REORDER = ('sites',
    dict(app='scifight',
         label='Tournament preparation',
         models=[
             'scifight.Tournament',
             'scifight.TournamentRound',
             'scifight.Team',
             'scifight.Participant',
             'scifight.Leader',
             'scifight.Room',
             'scifight.Problem',
             'scifight.Juror',
             'scifight.TeamOrigin',
             'scifight.PersonOrigin']),

    dict(app='scifight',
         label='Tournament progress',
         models=[
             'scifight.Fight',
             'scifight.FightStage']),

    dict(app='auth',
         label='Website administration',
         models=[
             'auth.User',
             'auth.Group']))

# === Override default settings with local-specific ones ===

from .settings_secret import *

# These lines are here just to suppress PyCharm's "unused import" warning.
assert SECRET_KEY
assert DATABASES
{'fraction_non_alphanumeric': 0.12997243009058684, 'fraction_numerical': 0.0052514113167913875, 'mean_word_length': 3.0413793103448277, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, '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': '5254438', 'n_tokens_mistral': 2447, 'n_tokens_neox': 2332, 'n_words': 334}