mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 09:31:09 -05:00
43 lines
1.8 KiB
Plaintext
43 lines
1.8 KiB
Plaintext
# Project Startup Rules
|
|
|
|
## Development Server
|
|
IMPORTANT: Always follow these instructions exactly when starting the development server:
|
|
|
|
```bash
|
|
lsof -ti :8000 | xargs kill -9; find . -type d -name "__pycache__" -exec rm -r {} +; uv run manage.py tailwind runserver
|
|
```
|
|
|
|
Note: These steps must be executed in this exact order as a single command to ensure consistent behavior.
|
|
|
|
## Package Management
|
|
IMPORTANT: When a Python package is needed, only use UV to add it:
|
|
```bash
|
|
uv add <package>
|
|
```
|
|
Do not attempt to install packages using any other method.
|
|
|
|
## Django Management Commands
|
|
IMPORTANT: When running any Django manage.py commands (migrations, shell, etc.), always use UV:
|
|
```bash
|
|
uv run manage.py <command>
|
|
```
|
|
This applies to all management commands including but not limited to:
|
|
- Making migrations: `uv run manage.py makemigrations`
|
|
- Applying migrations: `uv run manage.py migrate`
|
|
- Creating superuser: `uv run manage.py createsuperuser`
|
|
- Starting shell: `uv run manage.py shell`
|
|
|
|
NEVER use `python manage.py` or `uv run python manage.py`. Always use `uv run manage.py` directly.
|
|
|
|
## Static Files Management
|
|
IMPORTANT: All static files must be placed in the `static/` directory, not `staticfiles/`. The `staticfiles/` directory is reserved for Django's collectstatic command output and should not be used directly.
|
|
|
|
This consolidation:
|
|
1. Follows Django best practices of separating source static files from collected files
|
|
2. Prevents confusion between development and production static file locations
|
|
3. Makes it clear which static files are part of the source code (static/) versus compiled/collected (staticfiles/)
|
|
|
|
When adding new static files:
|
|
- Add them to `static/` directory
|
|
- Use Django's `static` template tag to reference them
|
|
- Run `uv run manage.py collectstatic` when deploying |