text: """
  Django settings for raiz project.
  
  Generated by 'django-admin startproject' using Django 3.2.9.
  
  For more information on this file, see
  https://docs.djangoproject.com/en/3.2/topics/settings/
  
  For the full list of settings and their values, see
  https://docs.djangoproject.com/en/3.2/ref/settings/
  """
  
  from pathlib import Path
  
  import os
  
  # Build paths inside the project like this: BASE_DIR / 'subdir'.
  BASE_DIR = Path(__file__).resolve().parent.parent
  
  
  # Quick-start development settings - unsuitable for production
  # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
  
  # SECURITY WARNING: keep the secret key used in production secret!
  SECRET_KEY = 'django-insecure-^9ei(h67g17e9n^1oi#4fetc_k@%m*t4^ciiy69dc-q^74i9xb'
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = True
  
  ALLOWED_HOSTS = ['projetoprometheus.com.br', '34.95.159.254', '127.0.0.1']
  
  
  # Application definition
  
  INSTALLED_APPS = [
  
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'django.contrib.humanize',
  
      # local apps
  
      'principal',
      'administracao',
      'blog_categorias',
      'blog_comentarios',
      'blog_posts',
  
      # terceiros apps
      'django_summernote',
      'crispy_forms',
      'axes',
  
  ]
  
  MIDDLEWARE = [
      'django.middleware.security.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',
      #middlewere de segurança de login axes
      'axes.middleware.AxesMiddleware',
  ]
  
  ROOT_URLCONF = 'raiz.urls'
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [os.path.join(BASE_DIR, 'templates')],
          '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',
              ],
          },
      },
  ]
  
  WSGI_APPLICATION = 'raiz.wsgi.application'
  
  
  # Database
  # https://docs.djangoproject.com/en/3.2/ref/settings/#databases
  
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.mysql', 
          'NAME': 'djangoDB', #nome do banco de dados
          'USER': 'root', #nome do usuario do banco de dados
          'PASSWORD': 'C9p513', # senha do banco de dados
          'HOST': 'localhost', #ip do banco de dados
          'PORT': '3306', #porta do banco de dados --mysql 3306
      }
  }
  
  #DATABASES = {
  #    'default': {
  #        'ENGINE': 'django.db.backends.sqlite3',
  #        'NAME': BASE_DIR / 'db.sqlite3',
  #    }
  #}
  
  
  # Password validation
  # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
  
  AUTH_PASSWORD_VALIDATORS = [
      {
          'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
      },
  ]
  
  
  # Internationalization
  # https://docs.djangoproject.com/en/3.2/topics/i18n/
  
  LANGUAGE_CODE = 'pt-br'
  
  TIME_ZONE = 'America/Sao_Paulo'
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  
  
  
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/3.2/howto/static-files/
  
  STATIC_URL = '/static/'
  STATICFILES_DIRS = (os.path.join(BASE_DIR, 'templates/static'),)
  STATIC_ROOT = os.path.join('static')
  
  MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  MEDIA_URL = '/media/'
  
  X_FRAME_OPTIONS = 'SAMEORIGIN'
  SUMMERNOTE_THEME = 'bs4' # Use Bootstrap4 theme
  
  
  CRISPY_TEMPLATE_PACK = 'bootstrap4'
  
  # fazendo a parte de segurança do axes funcional
  AUTHENTICATION_BACKENDS = [
      # AxesBackend should be the first backend in the AUTHENTICATION_BACKENDS list.
      'axes.backends.AxesBackend',
  
      # Django ModelBackend is the default authentication backend.
      'django.contrib.auth.backends.ModelBackend',
  ]
  
  # configuração do axes
  AXES_ENABLED = True #dizendo que o axes esta ativo
  AXES_FAILURE_LIMIT = 5 # numero de tentativas antes de bloquear o usuario
  AXES_ONLY_USER_FAILURES = True # bloqeando apenas o usuario que errou o login
  #AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP = True # bloqueia nome de usuário e endereço IP.
  AXES_LOCKOUT_CALLABLE = "administracao.views.erro403"
  
  
  from django.contrib.messages import constants
  
  MESSAGE_TAGS = {
          constants.ERROR: 'alert-danger',
          constants.WARNING: 'alert-warning',
          constants.DEBUG: 'alert-info',
          constants.SUCCESS: 'alert-success',
          constants.INFO: 'alert-info',
  }
  
  
  # Default primary key field type
  # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
  
  DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
  
  LOGIN_REDIRECT_URL = '/'
  
  LOGOUT_REDIRECT_URL = '/'
  