Skip to main content

Advanced requirements.txt generator for Django. Self-healing, PyPI dynamic mapping, and venv validation.

Project description

django-req-generator

Generador avanzado de requirements.txt / Advanced requirements.txt generator


🇲🇽 Español

Descripción

Este plugin para Django sirve para empaquetar tu proyecto e instalarlo de forma limpia en otros entornos (Docker, Servidores de Producción, CI/CD). Está específicamente diseñado para manejar proyectos Django complejos donde no basta con un simple pip freeze.

Características Principales

  • 🔍 Análisis Estático (AST): Detecta imports reales en todo el árbol de tu código fuente.
  • 🧩 Inspección Profunda de Django: Analiza INSTALLED_APPS, MIDDLEWARE, DATABASES (detecta drivers como oracledb), y CACHES (detecta django-redis y pymemcache).
  • 🧹 Limpieza Automática: Filtra la librería estándar de Python y tus propios módulos locales (apps, models, serializers, etc.).
  • 🔗 Resolución Dinámica PyPI: No usa mapeos manuales fallidos; pregunta directamente a la API de PyPI para encontrar el paquete correcto.
  • 🤖 Auto-curación Interactiva: Durante la validación, si detecta un módulo faltante (ModuleNotFoundError), te pregunta si quieres añadirlo y reintenta la validación en caliente.
  • 🧪 Validación en Venv: Crea un entorno virtual temporal para asegurar que el archivo generado permite que el proyecto arranque.
  • 🌎 Multilingüe: Soporta comandos y mensajes en Español e Inglés.

Uso

# Generación estándar con backup automático
python manage.py generate_reqs

# Generación con validación y settings específicos
python manage.py generate_reqs --validate --settings=mi_proyecto.settings_docker

# Modo Desarrollo (instala el plugin desde código fuente en la validación)
python manage.py generate_reqs --validate -d /ruta/al/plugin

🇺🇸 English

Description

This Django plugin is designed to package your project and install it cleanly in other environments (Docker, Production Servers, CI/CD). It is specifically built for complex Django projects where a simple pip freeze isn't enough.

Key Features

  • 🔍 Static Analysis (AST): Deep-scans your entire source code to detect actual imports.
  • 🧩 Deep Django Inspection: Analyzes INSTALLED_APPS, MIDDLEWARE, DATABASES (detects drivers like oracledb), and CACHES (detects django-redis and pymemcache).
  • 🧹 Automatic Cleanup: Filters out Python's standard library and your own local modules (apps, models, serializers, etc.).
  • 🔗 Dynamic PyPI Resolution: Replaces outdated manual mappings by querying the PyPI API directly for the correct package name.
  • 🤖 Interactive Self-Healing: During validation, if a missing module is found (ModuleNotFoundError), it asks if you want to add it and retries the validation on the fly.
  • 🧪 Venv Validation: Creates a temporary virtual environment to ensure the generated file allows the project to start.
  • 🌎 Multilingual: Supports commands and console messages in both Spanish and English.

Usage

# Standard generation with automatic backup
python manage.py generate_reqs

# Generation with validation and specific settings
python manage.py generate_reqs --validate --settings=my_project.settings_docker

# Development Mode (installs plugin from source during validation)
python manage.py generate_reqs --validate -d /path/to/plugin

Made with ❤️ and AI Collaboration | Creado con ❤️ y el apoyo de IA

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_req_generator-0.1.2.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_req_generator-0.1.2-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file django_req_generator-0.1.2.tar.gz.

File metadata

  • Download URL: django_req_generator-0.1.2.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for django_req_generator-0.1.2.tar.gz
Algorithm Hash digest
SHA256 bf367a74f0dc9508ba9388564f105f73be50b6aee0fca21ea66c67ca820ae290
MD5 a50471be6d4baa151d022cbaa13b443c
BLAKE2b-256 8afca1f76f34b850e2e75a16ad64fdf8002ac86a2c5c9c6434559fa20570a85b

See more details on using hashes here.

File details

Details for the file django_req_generator-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_req_generator-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e8e4f01471eab3ac5c60eff67baa1bbf48746ee1434414403febbf7139e2f3dc
MD5 8153ecacd93a48c719346eab010ffe54
BLAKE2b-256 2cf6ee27e261a9915910d0e7fb39e357a7a0bf723f77948a0cff634567c5c3ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page