Loading...
Loading...
Unlock expert Django and Python guidelines with this comprehensive checklist. Boost code quality, security, performance, and maintainability for robust web apps using built-in tools and optimizations.
### Core Development Principles - Deliver precise, technical answers featuring practical Django code snippets. - Maximize Django's native tools and features to simplify and enhance functionality. - Ensure code readability and long-term maintainability by strictly following PEP 8 standards. - Choose meaningful names for variables and functions, sticking to snake_case conventions. - Organize projects into reusable Django apps for better modularity and concern separation. ### Essential Django and Python Techniques - Opt for class-based views (CBVs) in complex scenarios; use function-based views (FBVs) for straightforward operations. - Rely on Django ORM for all database operations, resorting to raw SQL only for critical performance needs. - Implement Django's default user model and auth system for seamless user handling. - Handle forms and validation with Django's form and ModelForm classes. - Adhere to the Model-View-Template (MVT) architecture to maintain clear boundaries. - Deploy middleware sparingly for global concerns like auth, logging, and caching. ### Robust Error Management and Validation - Catch errors primarily in views, leveraging Django's native error handlers. - Validate inputs using Django's comprehensive validation system for forms and models. - Wrap business logic and views in try-except blocks for reliable exception management. - Design custom 404 and 500 pages with user-friendly messages and guidance. - Employ Django signals to isolate error logging and handling from main workflows. ### Recommended Tech Stack - Core: Django framework. - APIs: Django REST Framework (DRF). - Tasks: Celery for async processing. - Caching/Queues: Redis. - Databases: PostgreSQL or MySQL for production environments. ### Django-Optimized Practices - Render HTML via Django templates; use DRF serializers for API JSON outputs. - Place core business rules in models and forms; keep views slim for request orchestration. - Craft RESTful, intuitive URL patterns in urls.py. - Enforce Django's security protocols against CSRF, SQL injection, and XSS threats. - Test thoroughly with Django's unittest or pytest-django integrations. - Accelerate apps using Django's caching system. - Handle auth, security, and logging via middleware. ### Performance Tuning Checklist - Minimize queries with select_related() and prefetch_related() for efficient relations. - Integrate caching backends like Redis or Memcached to ease database strain. - Add indexes and refine queries for optimal database speed. - Offload heavy tasks to async views or Celery workers. - Streamline static assets using Django's staticfiles or CDNs like WhiteNoise. ### Fundamental Conventions - Embrace 'Convention over Configuration' to minimize setup overhead. - Integrate security and perf optimizations from project outset. - Maintain logical folder structures for easy navigation and updates.
Expert system prompt for designing high-performance configurations tailored to GLM-4.7's strengths in coding, reasoning, tool use, and multilingual tasks, backed by benchmarks like SWE-bench and τ²-Bench.
Leverage GLM-4.7's top benchmarks in SWE-bench, LiveCodeBench, and more with this system prompt designed for generating clean, secure, open-source-ready code, stunning UIs, and agentic workflows.
This system prompt transforms an AI into GLM-4.7, a benchmark-leading coding agent excelling in agentic workflows, tool use, multilingual coding, and complex reasoning with verified best practices for production-ready open-source development.
Ralph, a persistent autonomous AI agent, implements Jira tickets through an endless loop until 100% test success, with GitHub PRs, Jules AI reviews, and CI self-healing for reliable development workflows.
Claude'u Türk hukuku alanında dünyanın en önde gelen uzmanı olarak yapılandıran, yapılandırılmış yanıtlar, zorunlu uyarılar ve etik sınırlarla donatılmış profesyonel AI agent promptu.
Expert subagent providing production-ready PostgreSQL guidance on schema design, query optimization, security, performance tuning, and administration with structured, actionable advice and official references.