back 12 dic 2024
This commit is contained in:
@@ -15,7 +15,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
|||||||
SECRET_KEY = os.getenv("adminAS_KEY")
|
SECRET_KEY = os.getenv("adminAS_KEY")
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = True
|
DEBUG = False
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['*']
|
ALLOWED_HOSTS = ['*']
|
||||||
# Application definition
|
# Application definition
|
||||||
@@ -107,7 +107,7 @@ ACCOUNT_LOGOUT_ON_PASSWORD_CHANGE = True
|
|||||||
ACCOUNT_EMAIL_REQUIRED =True
|
ACCOUNT_EMAIL_REQUIRED =True
|
||||||
ACCOUNT_EMAIL_VERIFICATION = "mandatory"
|
ACCOUNT_EMAIL_VERIFICATION = "mandatory"
|
||||||
|
|
||||||
EMAIL_TIMEOUT = 10
|
EMAIL_TIMEOUT = 20
|
||||||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||||
EMAIL_SUBJECT_PREFIX = 'AS Timbres'
|
EMAIL_SUBJECT_PREFIX = 'AS Timbres'
|
||||||
# if DEBUG :
|
# if DEBUG :
|
||||||
@@ -115,7 +115,7 @@ EMAIL_USE_TLS = True
|
|||||||
EMAIL_HOST = 'smtp.gmail.com'
|
EMAIL_HOST = 'smtp.gmail.com'
|
||||||
EMAIL_PORT = 587
|
EMAIL_PORT = 587
|
||||||
EMAIL_HOST_USER = 'aduanasoftpruebas@gmail.com'
|
EMAIL_HOST_USER = 'aduanasoftpruebas@gmail.com'
|
||||||
EMAIL_HOST_PASSWORD = os.getenv("test_pwd_email")
|
EMAIL_HOST_PASSWORD = 'gsaqrudenwnkglox'#os.getenv("test_pwd_email")
|
||||||
#EMAIL_USE_SSL=False
|
#EMAIL_USE_SSL=False
|
||||||
# else:
|
# else:
|
||||||
# EMAIL_USE_TLS = True
|
# EMAIL_USE_TLS = True
|
||||||
|
|||||||
@@ -1,216 +0,0 @@
|
|||||||
|
|
||||||
from pathlib import Path
|
|
||||||
import os
|
|
||||||
import pytz
|
|
||||||
#print time zones
|
|
||||||
# for x in pytz.all_timezones_set:
|
|
||||||
# print(x)
|
|
||||||
|
|
||||||
|
|
||||||
# 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/4.1/howto/deployment/checklist/
|
|
||||||
# SECURITY WARNING: keep the secret key used in production secret!
|
|
||||||
SECRET_KEY = 'asdasd'#os.getenv("adminAS_KEY")
|
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
|
||||||
DEBUG = True
|
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['*']
|
|
||||||
# Application definition
|
|
||||||
INSTALLED_APPS = [
|
|
||||||
'django.contrib.admin',
|
|
||||||
'django.contrib.auth',
|
|
||||||
'django.contrib.contenttypes',
|
|
||||||
'django.contrib.sessions',
|
|
||||||
'django.contrib.messages',
|
|
||||||
#'django.contrib.sites',
|
|
||||||
'django.contrib.staticfiles',
|
|
||||||
'rest_framework',
|
|
||||||
'rest_framework.authtoken',
|
|
||||||
|
|
||||||
'allauth',
|
|
||||||
'allauth.account',
|
|
||||||
'allauth.socialaccount',
|
|
||||||
|
|
||||||
'widget_tweaks',
|
|
||||||
'import_export',
|
|
||||||
|
|
||||||
'Clientes',
|
|
||||||
'IMMEX',
|
|
||||||
'Sistemas',
|
|
||||||
]
|
|
||||||
REST_FRAMEWORK = {
|
|
||||||
'DEFAULT_AUTHENTICATION_CLASSES': [
|
|
||||||
'rest_framework.authentication.TokenAuthentication',
|
|
||||||
],
|
|
||||||
}
|
|
||||||
SITE_ID = 1
|
|
||||||
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 = 'Admin.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.contrib.auth.context_processors.auth',
|
|
||||||
'django.contrib.messages.context_processors.messages',
|
|
||||||
# `allauth` needs this from django
|
|
||||||
'django.template.context_processors.request',
|
|
||||||
#custom context processor
|
|
||||||
'Clientes.saldo_context_proc.get_saldo',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]
|
|
||||||
AUTHENTICATION_BACKENDS = [
|
|
||||||
|
|
||||||
# Needed to login by username in Django admin, regardless of `allauth`
|
|
||||||
'django.contrib.auth.backends.ModelBackend',
|
|
||||||
|
|
||||||
# `allauth` specific authentication methods, such as login by e-mail
|
|
||||||
'allauth.account.auth_backends.AuthenticationBackend',
|
|
||||||
]
|
|
||||||
|
|
||||||
WSGI_APPLICATION = 'Admin.wsgi.application'
|
|
||||||
ACCOUNT_FORMS = {
|
|
||||||
'login': 'allauth.account.forms.LoginForm',
|
|
||||||
'signup': 'allauth.account.forms.SignupForm',
|
|
||||||
'add_email': 'allauth.account.forms.AddEmailForm',
|
|
||||||
'change_password': 'allauth.account.forms.ChangePasswordForm',
|
|
||||||
'set_password': 'allauth.account.forms.SetPasswordForm',
|
|
||||||
'reset_password': 'allauth.account.forms.ResetPasswordForm',
|
|
||||||
'reset_password_from_key': 'allauth.account.forms.ResetPasswordKeyForm',
|
|
||||||
'disconnect': 'allauth.socialaccount.forms.DisconnectForm',
|
|
||||||
}
|
|
||||||
LOGIN_REDIRECT_URL = '/'
|
|
||||||
ACCOUNT_LOGOUT_REDIRECT_URL = '/accounts/login/'
|
|
||||||
ACCOUNT_SIGNUP_REDIRECT_URL =LOGIN_REDIRECT_URL
|
|
||||||
ACCOUNT_LOGOUT_ON_PASSWORD_CHANGE = True
|
|
||||||
#for email auth
|
|
||||||
ACCOUNT_EMAIL_REQUIRED =True
|
|
||||||
ACCOUNT_EMAIL_VERIFICATION = "mandatory"
|
|
||||||
|
|
||||||
EMAIL_TIMEOUT = 10
|
|
||||||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
|
||||||
EMAIL_SUBJECT_PREFIX = 'AS Timbres'
|
|
||||||
# if DEBUG :
|
|
||||||
EMAIL_USE_TLS = True
|
|
||||||
EMAIL_HOST = 'smtp.gmail.com'
|
|
||||||
EMAIL_PORT = 587
|
|
||||||
EMAIL_HOST_USER = 'aduanasoftpruebas@gmail.com'
|
|
||||||
EMAIL_HOST_PASSWORD = 'zsgtbxsuwyacyhqq'#os.getenv("test_pwd_email")
|
|
||||||
#EMAIL_USE_SSL=False
|
|
||||||
# else:
|
|
||||||
# EMAIL_USE_TLS = True
|
|
||||||
# EMAIL_HOST = 'secure.emailsrvr.com'
|
|
||||||
# EMAIL_PORT = 465
|
|
||||||
# EMAIL_HOST_USER = 'noreply@aduanasoft.com.mx'
|
|
||||||
# EMAIL_HOST_PASSWORD = 'N036p7y!'#os.getenv("pwd_email")
|
|
||||||
# #EMAIL_USE_SSL=True
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Database
|
|
||||||
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if DEBUG:
|
|
||||||
DATABASES = {
|
|
||||||
'default': {
|
|
||||||
'ENGINE': 'django.db.backends.mysql',
|
|
||||||
'NAME': 'cfdi_as2',
|
|
||||||
'USER': 'root',
|
|
||||||
'PASSWORD':'bardo28',#os.getenv("BD_PASS"),
|
|
||||||
'HOST': '127.0.0.1',
|
|
||||||
'PORT': '',
|
|
||||||
'OPTIONS': {'init_command': "SET sql_mode='STRICT_TRANS_TABLES'"},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
else:
|
|
||||||
DATABASES={
|
|
||||||
'default': {
|
|
||||||
'ENGINE': 'django.db.backends.mysql',
|
|
||||||
'NAME': 'fjrodriguez$default',
|
|
||||||
'USER': 'fjrodriguez',
|
|
||||||
'PASSWORD':'Soluciones28@',
|
|
||||||
'HOST': 'fjrodriguez.mysql.pythonanywhere-services.com',
|
|
||||||
'PORT': '3306',
|
|
||||||
'OPTIONS': {'init_command': "SET sql_mode='STRICT_TRANS_TABLES'"},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Password validation
|
|
||||||
# https://docs.djangoproject.com/en/4.1/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/4.1/topics/i18n/
|
|
||||||
|
|
||||||
LANGUAGE_CODE = 'es-MX'
|
|
||||||
|
|
||||||
TIME_ZONE = 'America/Chihuahua'
|
|
||||||
|
|
||||||
USE_I18N = True
|
|
||||||
|
|
||||||
USE_TZ = True
|
|
||||||
|
|
||||||
|
|
||||||
# Static files (CSS, JavaScript, Images)
|
|
||||||
# https://docs.djangoproject.com/en/4.1/howto/static-files/
|
|
||||||
|
|
||||||
if not DEBUG:
|
|
||||||
#STATIC_ROOT = os.path.join(BASE_DIR, "static")
|
|
||||||
STATICFILES_DIRS = [
|
|
||||||
BASE_DIR / 'static'
|
|
||||||
]
|
|
||||||
|
|
||||||
MEDIA_URL = '/media/'
|
|
||||||
MEDIA_ROOT = BASE_DIR / 'media'
|
|
||||||
STATIC_URL = '/static/'
|
|
||||||
if DEBUG:
|
|
||||||
|
|
||||||
STATICFILES_DIRS = [
|
|
||||||
BASE_DIR / 'static',
|
|
||||||
]
|
|
||||||
MEDIA_URL = '/media/'
|
|
||||||
MEDIA_ROOT = BASE_DIR / 'media'
|
|
||||||
STATIC_URL = '/static/'
|
|
||||||
#STATIC_ROOT = os.path.join(BASE_DIR, "static")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Default primary key field type
|
|
||||||
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
|
|
||||||
|
|
||||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
|
||||||
@@ -628,6 +628,6 @@ class SendTimbresDisponibleEmail(APIView):
|
|||||||
FJRR
|
FJRR
|
||||||
""",
|
""",
|
||||||
from_email='aduanasoftpruebas@gmail.com',
|
from_email='aduanasoftpruebas@gmail.com',
|
||||||
recipient_list=['fjrodriguez@aduanasoft.com.mx']#,'mcervantes@aduanasoft.com.mx','ddominguez@aduanasoft.com.mx'],
|
recipient_list=['fjrodriguez@aduanasoft.com.mx','mcervantes@aduanasoft.com.mx','ddominguez@aduanasoft.com.mx'],
|
||||||
)
|
)
|
||||||
return Response({'message':'Correo enviado exitosamente'})
|
return Response({'message':'Correo enviado exitosamente'})
|
||||||
17
IMMEX/migrations/0011_alter_suspensionpermiso_options.py
Normal file
17
IMMEX/migrations/0011_alter_suspensionpermiso_options.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Generated by Django 4.1.3 on 2024-02-04 05:28
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("IMMEX", "0010_alter_suspensionpermiso_suspension_modulo"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name="suspensionpermiso",
|
||||||
|
options={"ordering": ["suspension_modulo"]},
|
||||||
|
),
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user