inicio del proyecto
This commit is contained in:
commit
5c8b13e83e
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.venv
|
0
log/.gitkeep
Normal file
0
log/.gitkeep
Normal file
0
log/access.log
Normal file
0
log/access.log
Normal file
0
log/error.log
Normal file
0
log/error.log
Normal file
13
main.py
Normal file
13
main.py
Normal file
@ -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)
|
48
mapas.conf
Normal file
48
mapas.conf
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
# sudo apachectl configtest
|
||||||
|
Listen 8087
|
||||||
|
<VirtualHost *: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
|
||||||
|
|
||||||
|
<Directory /var/www/mapas>
|
||||||
|
WSGIProcessGroup app_mapas
|
||||||
|
WSGIApplicationGroup %{GLOBAL}
|
||||||
|
Order deny,allow
|
||||||
|
Require all granted
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
# Habilitar caché para todas las solicitudes
|
||||||
|
CacheEnable disk /
|
||||||
|
|
||||||
|
# Configuración de caché
|
||||||
|
<IfModule mod_cache_disk.c>
|
||||||
|
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
|
||||||
|
|
||||||
|
<FilesMatch "\.(jpg|jpeg|png|gif|css|js)$">
|
||||||
|
# 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
|
||||||
|
</FilesMatch>
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
</VirtualHost>
|
14
mapas.wsgi
Normal file
14
mapas.wsgi
Normal file
@ -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
|
7
requirements.txt
Normal file
7
requirements.txt
Normal file
@ -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
|
24128
templates/final_cat.html
Normal file
24128
templates/final_cat.html
Normal file
File diff suppressed because it is too large
Load Diff
699
templates/map_calor_geojson.html
Normal file
699
templates/map_calor_geojson.html
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user