""" Django settings for puebla project. Generated by 'django-admin startproject' using Django 2.2.10. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ """ import os import environ ROOT_DIR = environ.Path( __file__ ) - 2 PROJECT_DIR = ROOT_DIR.path( 'puebla' ) env = environ.Env() env_file = str( ROOT_DIR.path( '.env' ) ) env.read_env( env_file ) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'qadfx72cdm($dq&%_r0d03rah-m)pv0z*$g(*ghxdqfwfk^i=f' # SECURITY WARNING: don't run with debug turned on in production! # DEBUG = False DEBUG = env.bool( 'APP_DEBUG', default=True ) #ALLOWED_HOSTS = env.list( 'APP_ALLOWED_HOSTS', default=['localhost'] ) ALLOWED_HOSTS = ['*'] #Se cambió para poder acceder al sitio de manera local y desde cualquier dirección, cambiar en producción. SITE_URL = env.str( 'APP_SITE_URL', default='http://localhost/' ) # Application definition DJANGO_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.forms', ) THIRD_PARTY_APPS = ( 'mail_templated', 'requests', 'import_export', 'rangefilter', 'admin_numeric_filter', 'simple_history', 'ckeditor', ) LOCAL_APPS = ( 'core', 'apps.home', 'apps.catalogs', 'apps.sat_efirma', 'apps.complaints', 'apps.nonconformities', 'apps.administrators', ) INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS FORM_RENDERER = 'django.forms.renderers.TemplatesSetting' 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', ] ROOT_URLCONF = 'puebla.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS' : [ str( ROOT_DIR.path( '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 = 'puebla.wsgi.application' # Database # https://docs.djangoproject.com/en/2.2/ref/settings/#databases DATABASES = { 'default': { 'ENGINE' : env.str( 'DB_ENGINE', default='django.db.backends.mysql' ), 'NAME' : env.str( 'DB_NAME' ), 'USER' : env.str( 'DB_USER' ), 'PASSWORD': env.str( 'DB_PASSWORD' ), 'HOST' : env.str( 'DB_HOST' ), 'PORT' : env.int( 'DB_PORT' ), } } # Password validation # https://docs.djangoproject.com/en/2.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/2.2/topics/i18n/ LANGUAGE_CODE = env.str( 'APP_LANGUAGE_CODE', default='en-us' ) TIME_ZONE = env.str( 'APP_TIME_ZONE', default='UTC' ) USE_I18N = env.bool( 'APP_USE_I18N', default=True ) USE_L10N = env.bool( 'APP_USE_L10N', default=True ) USE_TZ = env.bool( 'APP_USE_TZ', default=True ) # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/2.2/howto/static-files/ STATIC_URL = '/static/' STATICFILES_DIRS = [ str( PROJECT_DIR.path( 'static' ) ), ] # STATIC_ROOT = str( PROJECT_DIR.path( 'static' ) ) MEDIA_URL = '/media/' MEDIA_ROOT = str( PROJECT_DIR.path( 'media' ) ) EMAIL_BACKEND = env.str( 'EMAIL_BACKEND', default='django.core.mail.backends.smtp.EmailBackend' ) EMAIL_HOST = env.str( 'EMAIL_HOST', default='smtp.gmail.com' ) EMAIL_HOST_USER = env.str( 'EMAIL_HOST_USER' ) EMAIL_HOST_PASSWORD = env.str( 'EMAIL_HOST_PASSWORD' ) EMAIL_PORT = env.int( 'EMAIL_PORT', default=465 ) EMAIL_USE_SSL = env.bool( 'EMAIL_USE_SSL', default=True ) #EMAIL_HOST_USER_COMPLAINT = 'arturo.cilia@puebla.gob.mx' #EMAIL_HOST_PASSWORD_COMPLAINT = '404otreumpuebla' EMAIL_HOST_USER_COMPLAINT = 'webmaster.dst@puebla.gob.mx' EMAIL_HOST_PASSWORD_COMPLAINT = 'iisy fvgs dfhr odjq' #EMAIL_HOST_USER_COMPLAINT = 'arturo.cilia@puebla.gob.mx' #EMAIL_HOST_PASSWORD_COMPLAINT = 'ArcePuebla407' #EMAIL_HOST_PASSWORD_COMPLAINT = 'sfpdaqd2024' #EMAIL_HOST_USER_COMPLAINT = 'jovanny.ramos@puebla.gob.mx'#'quejasydenuncias@puebla.gob.mx' #EMAIL_HOST_PASSWORD_COMPLAINT = 'gts5233t'#'24CD08QD2021' #EMAIL_HOST_USER_NONCONFORMITY = 'inconformidades.sfppue@puebla.gob.mx' #EMAIL_HOST_PASSWORD_NONCONFORMITY = 'dirjud2020' #EMAIL_HOST_USER_COMPLAINT = EMAIL_HOST_USER #EMAIL_HOST_PASSWORD_COMPLAINT = EMAIL_HOST_PASSWORD EMAIL_HOST_USER_NONCONFORMITY = EMAIL_HOST_USER EMAIL_HOST_PASSWORD_NONCONFORMITY = EMAIL_HOST_PASSWORD RECAPTCHA_SITE_KEY = env.str( 'RECAPTCHA_SITE_KEY' ) RECAPTCHA_SECRET_KEY = env.str( 'RECAPTCHA_SECRET_KEY' )