"""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)