<commit_before>"""Local setting for Proxito"""

# pylint: disable=missing-docstring

import os

from readthedocs.core.settings import Settings


class ProxitoDevSettings(Settings):

    DEBUG = False

    SECRET_KEY = 'replace-this-please'  # noqa
    ALLOWED_HOSTS = ['*']
    ROOT_URLCONF = 'readthedocs.proxito.urls'
    USE_SUBDOMAIN = True
    PUBLIC_DOMAIN = 'dev.readthedocs.io'
    PRODUCTION_DOMAIN = 'localhost:8000'

    SITE_ROOT = os.path.dirname(
        os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
    STATIC_ROOT = os.path.join(SITE_ROOT, 'static')
    STATIC_URL = '/static/'
    MEDIA_ROOT = os.path.join(SITE_ROOT, 'media/')

    # These are needed to import RTD models
    RTD_LATEST = 'latest'
    RTD_LATEST_VERBOSE_NAME = 'latest'
    RTD_STABLE = 'stable'
    RTD_STABLE_VERBOSE_NAME = 'stable'
    RTD_BUILD_MEDIA_STORAGE = 'readthedocs.builds.storage.BuildMediaFileSystemStorage'

    DOCKER_SOCKET = 'unix:///var/run/docker.sock'
    DOCKER_BUILD_IMAGES = None
    DOCKER_LIMITS = {'memory': '200m', 'time': 600}
    DOCKER_DEFAULT_IMAGE = 'readthedocs/build'
    DOCKER_VERSION = 'auto'
    DOCKER_DEFAULT_VERSION = 'latest'
    DOCKER_IMAGE = '{}:{}'.format(DOCKER_DEFAULT_IMAGE, DOCKER_DEFAULT_VERSION)
    DOCKER_IMAGE_SETTINGS = {}
    SLUMBER_API_HOST = ''
    SLUMBER_USERNAME = None
    SLUMBER_PASSWORD = None
    CLASS_OVERRIDES = {}
    DEFAULT_PRIVACY_LEVEL = 'public'
    DEFAULT_VERSION_PRIVACY_LEVEL = 'public'
    PUBLIC_DOMAIN_USES_HTTPS = False

    # @property
    # def DATABASES(self):  # noqa
    #     return {
    #         'default': {
    #             'ENGINE': 'django.db.backends.sqlite3',
    #             'NAME': os.path.join(self.SITE_ROOT, 'dev.db'),
    #         }
    #     }

    # Application classes
    @property
    def INSTALLED_APPS(self):  # noqa
        apps = [
            'django.contrib.auth',
            'django.contrib.contenttypes',
            'django.contrib.sessions',
            'django.contrib.staticfiles',
            'django.contrib.sites',
            'readthedocs.builds',
            'readthedocs.projects',
            'readthedocs.oauth',
            'allauth',
            'allauth.account',
            'allauth.socialaccount',
            'taggit',
        ]
        return apps

    MIDDLEWARE = (
        'django.contrib.sessions.middleware.SessionMiddleware',
        'django.middleware.common.CommonMiddleware',
        'django.middleware.security.SecurityMiddleware',
        'django.middleware.csrf.CsrfViewMiddleware',
        'django.middleware.clickjacking.XFrameOptionsMiddleware',
        'django.contrib.auth.middleware.AuthenticationMiddleware',
        'readthedocs.proxito.middleware.ProxitoMiddleware',
        'corsheaders.middleware.CorsMiddleware',
    )


ProxitoDevSettings.load_settings(__name__)

if not os.environ.get('DJANGO_SETTINGS_SKIP_LOCAL', False):
    try:
        # pylint: disable=unused-wildcard-import
        from .local_settings import *  # noqa<commit_msg>Much simpler settings file<commit_after>"""Local setting for Proxito"""

# pylint: disable=missing-docstring

import os

from readthedocs.settings import base


class ProxitoDevSettings(base.CommunityBaseSettings):

    ALLOWED_HOSTS = ['*']
    ROOT_URLCONF = 'readthedocs.proxito.urls'
    USE_SUBDOMAIN = True

    PUBLIC_DOMAIN = 'dev.readthedocs.io'
    PRODUCTION_DOMAIN = 'localhost:8000'
    PUBLIC_DOMAIN_USES_HTTPS = False

    @property
    def MIDDLEWARE(self):  # noqa
        classes = super().MIDDLEWARE
        classes = list(classes)
        index = classes.index(
            'readthedocs.core.middleware.SubdomainMiddleware'
        )
        classes[index] = 'readthedocs.proxito.middleware.ProxitoMiddleware'
        return classes


ProxitoDevSettings.load_settings(__name__)

if not os.environ.get('DJANGO_SETTINGS_SKIP_LOCAL', False):
    try:
        # pylint: disable=unused-wildcard-import
        from .local_settings import *  # noqa
{'fraction_non_alphanumeric': 0.10825780463242698, 'fraction_numerical': 0.0037764350453172208, 'mean_word_length': 2.914285714285714, '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': '4915547', 'n_tokens_mistral': 1386, 'n_tokens_neox': 1339, 'n_words': 194}