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

View File

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

View File

@@ -18,7 +18,7 @@ from .views import (
)
urlpatterns = [
path('', index, name='index'),
path('', index, name='index'),
path('add_timbre2/', add_timbre2.as_view(), name='add_timbre2'),
path('timbres_cliente/<str:RFC>/', timbres_cliente, name='timbres_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('datepickerFin','')
filters.pop('mes','')
#print('filters------',filters)
if rfcc:
print('filters------',filters)
if rfcc and search:
clientes_list = Clientes.objects.filter(Q(RFC__icontains=search))
# for i,ii in enumerate(clientes_list):

View File

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

View File

@@ -2,7 +2,7 @@
<span class="navbar-text mr-2">
Fecha: <strong>{{fecha|date:"d F Y"}}</strong>
</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 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>
</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>