commit 5c8b13e83e907d652677ebda2e1956a8ba017d6e Author: David Itehua Xalamihua Date: Sun Jul 27 16:48:57 2025 -0600 inicio del proyecto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b694934 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.venv \ No newline at end of file diff --git a/log/.gitkeep b/log/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/log/access.log b/log/access.log new file mode 100644 index 0000000..e69de29 diff --git a/log/error.log b/log/error.log new file mode 100644 index 0000000..e69de29 diff --git a/main.py b/main.py new file mode 100644 index 0000000..625bcc3 --- /dev/null +++ b/main.py @@ -0,0 +1,13 @@ +from flask import Flask, render_template, request, jsonify +app = Flask(__name__) + +@app.route('/') +def home(): + return render_template('final_cat.html') + +@app.route('/heat-map') +def heat_map(): + return render_template('map_calor_geojson.html') + +if __name__ == '__main__': + app.run(debug=True, port=8087) \ No newline at end of file diff --git a/mapas.conf b/mapas.conf new file mode 100644 index 0000000..6778db7 --- /dev/null +++ b/mapas.conf @@ -0,0 +1,48 @@ +# sudo apachectl configtest +Listen 8087 + + ServerAdmin davidix1991@gmail.com + ServerName mapas.temporal.work + ServerAlias mapas.temporal.work + DocumentRoot /var/www/mapas + + WSGIDaemonProcess app_mapas user=www-data group=www-data threads=6 python-home=/var/www/mapas/.venv + WSGIScriptAlias / /var/www/mapas/mapas.wsgi + + ErrorLog /var/www/mapas/log/error.log + CustomLog /var/www/mapas/log/access.log combined + + + WSGIProcessGroup app_mapas + WSGIApplicationGroup %{GLOBAL} + Order deny,allow + Require all granted + + + # Habilitar caché para todas las solicitudes + CacheEnable disk / + + # Configuración de caché + + CacheRoot /var/cache/apache2/mod_cache_disk + CacheDirLevels 2 + CacheDirLength 1 + # [bytes] Tamaño máximo de archivo a almacenar en caché + CacheMaxFileSize 1000000 + # CacheMinFileSize bytes + CacheMinFileSize 1 + CacheIgnoreHeaders Set-Cookie + CacheIgnoreNoLastMod On + + + # Indica si el caché está funcionando + Header set X-Cache "HIT from Apache" + # Expiración por defecto (1 hora) + CacheDefaultExpire 3600 + # Expiración máxima (1 día) + CacheMaxExpire 86400 + CacheLastModifiedFactor 0.5 + + + + diff --git a/mapas.wsgi b/mapas.wsgi new file mode 100644 index 0000000..2fae96f --- /dev/null +++ b/mapas.wsgi @@ -0,0 +1,14 @@ +import sys +import logging + +# ruta de linux al proyecto de flask +sys.path.insert(0, '/var/www/mapas') + +# ruta de linux al ambiente virtual de flask +sys.path.insert(0, '/var/www/mapas/.venv/lib/python3.12/site-packages') + +# Set up logging +logging.basicConfig(stream=sys.stderr, level=logging.DEBUG) + +# Import and run the Flask app +from main import app as application diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..12f6949 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,7 @@ +blinker==1.9.0 +click==8.2.1 +Flask==3.1.1 +itsdangerous==2.2.0 +Jinja2==3.1.6 +MarkupSafe==3.0.2 +Werkzeug==3.1.3 diff --git a/templates/final_cat.html b/templates/final_cat.html new file mode 100644 index 0000000..3484fad --- /dev/null +++ b/templates/final_cat.html @@ -0,0 +1,24128 @@ + + + + + + Teleescuelas + + + + + + + + + + + + + + + + + + + + + + + + + +

Teleescuelas

+ + + +
+ + + + Mapa Teleescuelas por Estado + +
+ + + + +
+
+ +
+
+
+ + +
+
+

Resumen

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EstadoTeleescuela
sin
plan
Teleescuela
wifi
funcionando
Teleescuela
HBB aprobado
altan
Teleescuela
duplicada
Teleescuela
FO comercial
Teleescuela HBB
aprobado
altan * Adicionales
Teleescuela con
coordenadas
no validas
Teleescuela
inactiva
Tele
satelital
(SEP)
Total%
Veracruz1,709560677652962582003,56715%
Chiapas1,06031821719219260001,8328%
Oaxaca1,06626419959373443101,7037%
Estado De México4293711453901291000001,5647%
Puebla783224170332021120001,5246%
Guanajuato343256269391961210101,4776%
Guerrero8341941532181802001,3656%
San Luis Potosí7817320343331812201,1655%
Michoacán595119131701257044001,1545%
Zacatecas4522271148262320209714%
Hidalgo5051001575859240109044%
Jalisco3231051325957250107023%
Durango380891134015222106623%
Chihuahua2486853130351624005742%
Tabasco2938977396120005162%
Sinaloa2185567771450004362%
Yucatán8010061138260003872%
Nayarit185592343191211003521%
Tamaulipas1822794916180303491%
Sonora13795381816100003141%
Coahuila10618448311280002901%
Querétaro117596212290002701%
Aguascalientes6952553611350012591%
Quintana Roo924577267110002581%
Campeche6878253110001761%
Nuevo León8492443490001731%
Morelos17487746340001591%
Tlaxcala218118311170001511%
Baja California Sur61145620130001191%
Baja California2723252940201191%
Colima1524171675000840%
Ciudad De México0843013000460%
Total11,2803,8523,4332,2631,4691,17014014123,622100%
Porcentaje48%16%15%10%6%5%1%0%0%100%
+
+
+
+
+ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/map_calor_geojson.html b/templates/map_calor_geojson.html new file mode 100644 index 0000000..0e6c844 --- /dev/null +++ b/templates/map_calor_geojson.html @@ -0,0 +1,699 @@ + + + + + + Mapa de calor sitios por entidad + + + + + + + + + + + + + + + + + + + + +

Conteo Teleescuelas por Estado

+ +
+ + Distribución de Teleescuelas en mapa + +
+ + +
+ + + + + + + +