Enhance static files management guidelines: clarify directory structure, file management rules, and benefits of separation for better adherence to Django best practices

This commit is contained in:
pacnpal
2025-02-23 12:09:18 -05:00
parent 45948bcc80
commit 8e9b6b6a15
2 changed files with 31 additions and 1 deletions

View File

@@ -21,6 +21,23 @@
- Implement component-based structure
- Follow progressive enhancement
### Static Files Organization
1. Directory Structure
- `static/` - Source static files (CSS, JS, images, etc.)
- `staticfiles/` - Collected files (generated by collectstatic)
2. File Management Rules
- Place all source static files in `static/` directory
- Never directly modify `staticfiles/` directory
- Use Django's `static` template tag for references
- Run collectstatic before deployment
3. Benefits of Separation
- Clear distinction between source and compiled files
- Prevents confusion in development vs production
- Follows Django best practices
- Simplifies deployment process
## Design Patterns
### Data Access