Carga
Carga
This commit is contained in:
0
sensores/__init__.py
Normal file
0
sensores/__init__.py
Normal file
BIN
sensores/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
sensores/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
BIN
sensores/__pycache__/settings.cpython-310.pyc
Normal file
BIN
sensores/__pycache__/settings.cpython-310.pyc
Normal file
Binary file not shown.
BIN
sensores/__pycache__/urls.cpython-310.pyc
Normal file
BIN
sensores/__pycache__/urls.cpython-310.pyc
Normal file
Binary file not shown.
BIN
sensores/__pycache__/wsgi.cpython-310.pyc
Normal file
BIN
sensores/__pycache__/wsgi.cpython-310.pyc
Normal file
Binary file not shown.
16
sensores/asgi.py
Normal file
16
sensores/asgi.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""
|
||||
ASGI config for sensores project.
|
||||
|
||||
It exposes the ASGI callable as a module-level variable named ``application``.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from django.core.asgi import get_asgi_application
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sensores.settings')
|
||||
|
||||
application = get_asgi_application()
|
||||
212
sensores/settings.py
Normal file
212
sensores/settings.py
Normal file
@@ -0,0 +1,212 @@
|
||||
"""
|
||||
Django settings for sensores project.
|
||||
|
||||
Generated by 'django-admin startproject' using Django 4.0.5.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/4.0/topics/settings/
|
||||
|
||||
For the full list of settings and their values, see
|
||||
https://docs.djangoproject.com/en/4.0/ref/settings/
|
||||
"""
|
||||
from django.contrib.messages import constants as message_constants
|
||||
import os
|
||||
from pathlib import Path
|
||||
from dotenv import load_dotenv
|
||||
# Load environment variables from .env file
|
||||
load_dotenv()
|
||||
|
||||
# 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.0/howto/deployment/checklist/
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = 'django-insecure-wo1z0gvd543szc$6_and3$6@p#*x)3_$+nc^s$y-po#ul26_g%'
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = ['localhost', '127.0.0.1', '192.168.1.150', 'server.mxsig.com.mx']
|
||||
|
||||
|
||||
# Application definition
|
||||
|
||||
INSTALLED_APPS = [
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
|
||||
'crispy_forms',
|
||||
'crispy_bootstrap4',
|
||||
'ckeditor',
|
||||
'tinymce',
|
||||
'xhtml2pdf',
|
||||
|
||||
'principal',
|
||||
'autenticacion',
|
||||
|
||||
'fijos',
|
||||
'moviles',
|
||||
|
||||
]
|
||||
|
||||
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 = 'sensores.urls'
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': ['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 = 'sensores.wsgi.application'
|
||||
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': os.getenv("DB_ENGINE", default=""),
|
||||
'NAME': os.getenv("DB_NAME", default=""),
|
||||
'USER': os.getenv("DB_USER", default=""),
|
||||
'PASSWORD': os.getenv("DB_PASSWORD", default=""),
|
||||
'HOST': os.getenv("DB_HOST", default=""),
|
||||
'PORT': os.getenv("DB_PORT", default=""),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Password validation
|
||||
# https://docs.djangoproject.com/en/4.0/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.0/topics/i18n/
|
||||
|
||||
LANGUAGE_CODE = 'es-MX'
|
||||
|
||||
TIME_ZONE = 'America/Mexico_City'
|
||||
|
||||
USE_I18N = True
|
||||
|
||||
USE_TZ = False
|
||||
|
||||
|
||||
# Static files (CSS, JavaScript, Images)
|
||||
# https://docs.djangoproject.com/en/4.0/howto/static-files/
|
||||
|
||||
STATIC_URL = 'static/'
|
||||
MEDIA_URL = 'images/'
|
||||
|
||||
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
|
||||
|
||||
STATICFILES_DIRS = [
|
||||
os.path.join(BASE_DIR, 'static'),
|
||||
]
|
||||
|
||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'static/images')
|
||||
|
||||
# Default primary key field type
|
||||
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
|
||||
|
||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||
|
||||
|
||||
CRISPY_TEMPLATE_PACK = 'bootstrap4'
|
||||
|
||||
|
||||
MESSAGE_TAGS = {
|
||||
message_constants.DEBUG: 'debug',
|
||||
message_constants.INFO: 'info',
|
||||
message_constants.SUCCESS: 'success',
|
||||
message_constants.WARNING: 'warning',
|
||||
message_constants.ERROR: 'danger',
|
||||
}
|
||||
|
||||
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||
EMAIL_HOST = 'smtp.gmail.com'
|
||||
EMAIL_PORT = 587
|
||||
EMAIL_USE_TLS = True
|
||||
EMAIL_HOST_USER = 'acceso.qr.uptap@gmail.com'
|
||||
EMAIL_HOST_PASSWORD = 'rssauvqqormpeyro'
|
||||
|
||||
|
||||
|
||||
CKEDITOR_CONFIGS = {
|
||||
'default': {
|
||||
'toolbar': None,
|
||||
}
|
||||
}
|
||||
|
||||
TINYMCE_DEFAULT_CONFIG = {
|
||||
'height': 360,
|
||||
'width': 1120,
|
||||
'cleanup_on_startup': True,
|
||||
'custom_undo_redo_levels': 20,
|
||||
'selector': 'textarea',
|
||||
'theme': 'silver',
|
||||
'plugins': '''
|
||||
textcolor save link image media preview codesample contextmenu
|
||||
table code lists fullscreen insertdatetime nonbreaking
|
||||
contextmenu directionality searchreplace wordcount visualblocks
|
||||
visualchars code fullscreen autolink lists charmap print hr
|
||||
anchor pagebreak
|
||||
''',
|
||||
'toolbar1': '''
|
||||
fullscreen preview bold italic underline | fontselect,
|
||||
fontsizeselect | forecolor backcolor | alignleft alignright |
|
||||
aligncenter alignjustify | indent outdent | bullist numlist table |
|
||||
| link image media | codesample |
|
||||
''',
|
||||
'toolbar2': '''
|
||||
visualblocks visualchars |
|
||||
charmap hr pagebreak nonbreaking anchor | code |
|
||||
''',
|
||||
'contextmenu': 'formats | link image',
|
||||
'menubar': True,
|
||||
'statusbar': True,
|
||||
}
|
||||
|
||||
APPEND_SLASH=False
|
||||
60
sensores/urls.py
Normal file
60
sensores/urls.py
Normal file
@@ -0,0 +1,60 @@
|
||||
"""sensores URL Configuration
|
||||
|
||||
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||
https://docs.djangoproject.com/en/4.0/topics/http/urls/
|
||||
Examples:
|
||||
Function views
|
||||
1. Add an import: from my_app import views
|
||||
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
||||
Class-based views
|
||||
1. Add an import: from other_app.views import Home
|
||||
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
||||
Including another URLconf
|
||||
1. Import the include() function: from django.urls import include, path
|
||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.contrib import admin
|
||||
from django.urls import path, include
|
||||
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
||||
from django.conf import settings
|
||||
from django.contrib.auth import views as auth_views
|
||||
from django.conf.urls.static import static
|
||||
from principal.views import inicio
|
||||
from autenticacion.views import VistaRegistro, salir, acceder, usuarios, userupdate
|
||||
from fijos.views import sensoresf, SensoresFijos, altasensoresf, ActualizarSensor, ConsultaSensoresf, sensoresfijosdia, sensoresfijosdianew, confTelegram, ActualizarTelegram, ConsultaSensoresRango, CheckSensoresActivos
|
||||
from moviles.views import sensoresm
|
||||
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path('tinymce/', include('tinymce.urls')),
|
||||
path('', inicio, name='index'),
|
||||
|
||||
path('acceder/', acceder, name='acceder'),
|
||||
path('registro/', VistaRegistro.as_view(), name='registro'),
|
||||
path('usuarios/', usuarios, name='usuarios'),
|
||||
path('usuarios/actualizar/<int:id>', userupdate, name='userupdate'),
|
||||
path('salir/', salir, name='salir'),
|
||||
|
||||
path('telegram/', confTelegram, name='telegram'),
|
||||
path('actualizatelegram/<int:id>', ActualizarTelegram, name='actualizatelegram'),
|
||||
|
||||
path('sensoresfijos/', SensoresFijos.as_view(), name='sensoresfijos'),
|
||||
path('sensoresf/', sensoresf, name='sensoresf'),
|
||||
path('sensoresm/', sensoresm, name='sensoresm'),
|
||||
path('altasensoresf/', altasensoresf, name='altasensoresf'),
|
||||
path('actualizasensorf/<int:id>', ActualizarSensor, name='actualizasensorf'),
|
||||
path('consultasensorfijo/', ConsultaSensoresf, name='consultasensorfijo'),
|
||||
path('sensoresfijosdia/', sensoresfijosdia, name='sensoresfijosdia'),
|
||||
path('sensoresfijosdianew/<str:id>', sensoresfijosdianew, name='sensoresfijosdianew'),
|
||||
path('sensorestablarango/', ConsultaSensoresRango, name='sensoresrango'),
|
||||
path('checksensores/', CheckSensoresActivos, name='checksensores'),
|
||||
|
||||
path('reset_password/', auth_views.PasswordResetView.as_view(template_name="password_reset.html"), name="reset_password"),
|
||||
path('reset_password_sent/', auth_views.PasswordResetDoneView.as_view(template_name="password_reset_sent.html"), name="password_reset_done"),
|
||||
path('reset/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view(template_name="password_reset_form.html"), name="password_reset_confirm"),
|
||||
path('reset_password_complete/', auth_views.PasswordResetCompleteView.as_view(template_name="password_reset_done.html"), name="password_reset_complete"),
|
||||
]
|
||||
urlpatterns += staticfiles_urlpatterns()
|
||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
16
sensores/wsgi.py
Normal file
16
sensores/wsgi.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""
|
||||
WSGI config for sensores project.
|
||||
|
||||
It exposes the WSGI callable as a module-level variable named ``application``.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from django.core.wsgi import get_wsgi_application
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sensores.settings')
|
||||
|
||||
application = get_wsgi_application()
|
||||
Reference in New Issue
Block a user