minimal changes

This commit is contained in:
fjrodriguez
2022-12-22 14:08:17 -06:00
parent 53230f122f
commit bd2c214273
6 changed files with 22 additions and 28 deletions

View File

@@ -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 = False DEBUG = True
ALLOWED_HOSTS = ['*'] ALLOWED_HOSTS = ['*']
# Application definition # Application definition
@@ -34,7 +34,7 @@ INSTALLED_APPS = [
'allauth.account', 'allauth.account',
'allauth.socialaccount', 'allauth.socialaccount',
'widget_tweaks', 'widget_tweaks',
'Admin',
'Clientes', 'Clientes',
] ]
REST_FRAMEWORK = { REST_FRAMEWORK = {
@@ -99,27 +99,25 @@ ACCOUNT_SIGNUP_REDIRECT_URL =LOGIN_REDIRECT_URL
ACCOUNT_LOGOUT_ON_PASSWORD_CHANGE = True ACCOUNT_LOGOUT_ON_PASSWORD_CHANGE = True
if DEBUG: EMAIL_TIMEOUT = 10
EMAIL_TIMEOUT = 10 EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True EMAIL_SUBJECT_PREFIX = 'AS Timbres'
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' if DEBUG:
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 = 'zsgtbxsuwyacyhqq' EMAIL_HOST_PASSWORD = os.getenv("test_pwd_email")
EMAIL_SUBJECT_PREFIX = 'AS Timbres' #EMAIL_USE_SSL=False
#EMAIL_USE_SSL=True else:
else: EMAIL_USE_TLS = False
EMAIL_TIMEOUT = 10
EMAIL_USE_TLS = False
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'secure.emailsrvr.com' EMAIL_HOST = 'secure.emailsrvr.com'
EMAIL_PORT = 465 EMAIL_PORT = 465
EMAIL_HOST_USER = 'noreply@aduanasoft.com.mx' EMAIL_HOST_USER = 'noreply@aduanasoft.com.mx'
EMAIL_HOST_PASSWORD = 'N036p7y!' EMAIL_HOST_PASSWORD = os.getenv("pwd_email")
EMAIL_SUBJECT_PREFIX = 'AS Timbres'
EMAIL_USE_SSL=True EMAIL_USE_SSL=True
# Database # Database
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases # https://docs.djangoproject.com/en/4.1/ref/settings/#databases

View File

@@ -13,29 +13,22 @@ def response_error_handler(request, exception=None):
context={} context={}
return render(request, '403.html',context,status=403) return render(request, '403.html',context,status=403)
def permission_denied_view(request): def permission_denied_view(request):
raise PermissionDenied raise PermissionDenied
urlpatterns = [ urlpatterns = [
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
path('accounts/', include('allauth.urls')), path('accounts/', include('allauth.urls')),
path('DRF_Token/', obtain_auth_token, name='DRF_Token'), path('DRF_Token/', obtain_auth_token, name='DRF_Token'),
path('', include('Clientes.urls')), path('', include('Clientes.urls')),
path('403/', permission_denied_view), path('403/', permission_denied_view),
] ]
handler403 = response_error_handler handler403 = response_error_handler
if settings.DEBUG: #DEV only if settings.DEBUG: #DEV only
urlpatterns += static(settings.STATIC_URL, document_root= settings.STATIC_ROOT) urlpatterns += static(settings.STATIC_URL, document_root= settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root= settings.MEDIA_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root= settings.MEDIA_ROOT)
# ROOT_URLCONF must specify the module that contains handler403 = ... # ROOT_URLCONF must specify the module that contains handler403 = ...
@override_settings(ROOT_URLCONF=__name__) @override_settings(ROOT_URLCONF=__name__)
class CustomErrorHandlerTests(SimpleTestCase): class CustomErrorHandlerTests(SimpleTestCase):

View File

@@ -18,7 +18,7 @@ from .views import (
) )
urlpatterns = [ urlpatterns = [
path('', index, name='index'), path('', index, name='index'),
path('add_timbre2/', add_timbre2.as_view(), name='add_timbre2'), path('add_timbre2/', add_timbre2.as_view(), name='add_timbre2'),
path('timbres_cliente/<str:RFC>/', timbres_cliente, name='timbres_cliente'), path('timbres_cliente/<str:RFC>/', timbres_cliente, name='timbres_cliente'),
path('cliente/update/<int:pk>/',ClientesUpdateView.as_view(),name='update_cliente'), path('cliente/update/<int:pk>/',ClientesUpdateView.as_view(),name='update_cliente'),

View File

@@ -174,8 +174,8 @@ def index(request):
filters.pop('datepicker','') filters.pop('datepicker','')
filters.pop('datepickerFin','') filters.pop('datepickerFin','')
filters.pop('mes','') filters.pop('mes','')
#print('filters------',filters) print('filters------',filters)
if rfcc: if rfcc and search:
clientes_list = Clientes.objects.filter(Q(RFC__icontains=search)) clientes_list = Clientes.objects.filter(Q(RFC__icontains=search))
# for i,ii in enumerate(clientes_list): # for i,ii in enumerate(clientes_list):

View File

@@ -303,7 +303,10 @@ Timbres disponibles Comercio Digital: {{saldo}}
table_rfcc.addEventListener('click',(event)=>{ table_rfcc.addEventListener('click',(event)=>{
document.getElementById('rfcc').checked= table_rfcc.checked? true:false; document.getElementById('rfcc').checked= table_rfcc.checked? true:false;
}) })
window.addEventListener("load", (event)=>{ window.addEventListener("load", (event)=>{
let mes ='{{mes}}' let mes ='{{mes}}'

View File

@@ -2,7 +2,7 @@
<span class="navbar-text mr-2"> <span class="navbar-text mr-2">
Fecha: <strong>{{fecha|date:"d F Y"}}</strong> Fecha: <strong>{{fecha|date:"d F Y"}}</strong>
</span> </span>
<form action="{{request.path}}" method="get" class="form-inline my-2 my-lg-0 my_event_cls"> <form id="searchForm" action="{{request.path}}" method="get" class="form-inline my-2 my-lg-0 my_event_cls">
<input style="display:none" id="mes_id" class="form-control mr-sm-2 my_event_cls" name="mes" type="input" aria-label="mes"> <input style="display:none" id="mes_id" class="form-control mr-sm-2 my_event_cls" name="mes" type="input" aria-label="mes">
<input id="search" class="form-control mr-sm-2 my_event_cls" name="search" type="search" placeholder="Search" aria-label="Search"> <input id="search" class="form-control mr-sm-2 my_event_cls" name="search" type="search" placeholder="Search" aria-label="Search">
@@ -29,5 +29,5 @@
});*/ });*/
</script> </script>
</div> </div>
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button> <button id="id_searchbtn" class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form> </form>