Fundamentos de Deployment y Control de Versiones
¿Cómo Desplegar Aplicaciones Python?
Introducción a WSGI y ASGI para aplicaciones Python
Control de versiones en Git y prácticas de versionamiento en Python
Configuración de entornos de desarrollo para despliegue
Buenas prácticas en el uso de variables de entorno
Configuración de Servidores en la Nube para Despliegue
Fundamentos de servidores y conexión por SSH
Creación y configuración de instancias en AWS, Linode y DigitalOcean
Creación de instancias en AWS
Configuración de SSH
Instalación y gestión de paquetes en el servidor
Configuración de DNS para dominios en despliegue
Certificados SSL con Let’s Encrypt para seguridad en producción
Administración y Optimización de Servidores para Producción
Configuración de servidores web y aplicaciones con WSGI y ASGI
¿Cómo configurar UWSGI con Python y NginX en producción?
Configuración de Proxy Reverso en Nginx para Aplicaciones WSGI
Manejo de errores y configuración de logs en producción
Monitoreo de aplicaciones Python en producción usando Sentry
¿Cómo configurar un archivo .env en Django para producción?
Integración de Servicios Complementarios para Aplicaciones Python
Configuración de Bases de Datos PostgreSQL en el Servidor de la Aplicación
Configuración de Bases de Datos en Producción con Amazon RDS
Servicios para archivos estáticos (S3, Cloudflare)
Automatización y CI/CD para Despliegues Python
Automatización de despliegue con Ansible
You don't have access to this class
Keep learning! Join and start boosting your career
When deploying our Python applications, it is normal for them to work correctly at first. However, as changes are made or specific scenarios occur, errors may arise. Setting up detailed logs is essential not only to detect failures more easily, but also to group them according to the running application, simplifying the diagnosis and correction process. Logs allow to identify and solve problems efficiently by providing historical records of the events and errors that occur.
To optimize log management, it is important to group them within your Django applications, aligned with web servers such as Nginx and application managers such as UWSGI. The methodology to achieve this goal is described below:
Git branches and code changes:
develop
to create and test changes before merging them to main
or production.Review and install new dependencies:
pip install -r requirements.txt.
sudo service uwsgi restart
Understand the importance of logs:
Strategy for debugging and security logs:
Group and structure logs in Nginx:
/etc/nginx/sites-enabled/
) to specify separate log locations:access_log /var/log/nginx/deploy_with_python_access.log;error_log /var/log/nginx/deploy_with_python_error.log;
sudo nginx -t
sudo service nginx restart
After configuring the logs correctly, it is time for proactive monitoring:
Dynamic log monitoring:
tail
command to track real-time changes in your log files:sudo tail -f /var/log/nginx/deploy_with_python_access.log
Identify and verify requests and errors:
As a next step in your log management mastery, you are challenged to configure UWSGI to store its logs in application-specific files, thus complementing the logging strategy initiated with Nginx. This not only gives you detailed insight into your application's performance, but also enhances your ability to effectively address and resolve potential problems.
Contributions 0
Questions 0
Want to see more contributions, questions and answers from the community?