# Scripts Directory

Utility scripts for development and maintenance.

## Available Scripts

### 1. `compile_po.py`
Compile translation files (.po) to binary format (.mo).

**Usage:**
```bash
python scripts/compile_po.py
```

**Purpose:** Convert human-readable translation files into the format Django uses at runtime.

**When to use:**
- After updating translation strings
- Before deploying to production
- When adding new language translations

---

### 2. `run_dev.bat` (Windows)
Batch script to run Django development server on Windows.

**Usage:**
```bash
scripts\run_dev.bat
```

**What it does:**
- Activates virtual environment
- Runs `python manage.py runserver`

**Prerequisites:**
- Virtual environment at `venv/`
- Python installed and in PATH

---

### 3. `run_dev.ps1` (Windows PowerShell)
PowerShell script to run Django development server on Windows.

**Usage:**
```powershell
powershell -ExecutionPolicy Bypass -File scripts/run_dev.ps1
```

**What it does:**
- Activates virtual environment
- Runs `python manage.py runserver`

**Note:** May require execution policy adjustment on Windows.

---

## Quick Commands Reference

### Start Development Server (Manual)
```bash
# Activate virtual environment
venv\Scripts\activate  # Windows
source venv/bin/activate  # macOS/Linux

# Run server
python manage.py runserver
```

### Make Migrations
```bash
python manage.py makemigrations
python manage.py migrate
```

### Collect Static Files
```bash
python manage.py collectstatic --noinput
```

### Create Superuser
```bash
python manage.py createsuperuser
```

### Access Django Shell
```bash
python manage.py shell
```

### Run Tests
```bash
python manage.py test
```

---

## Adding New Scripts

1. Create script file in this directory
2. Add shebang for Python: `#!/usr/bin/env python`
3. Update this README with usage instructions
4. Test the script before committing
5. Document any external dependencies

## Troubleshooting

### Script won't run on Windows
- Check virtual environment is in `venv/` directory
- Verify Python is installed and accessible
- Try PowerShell version instead of batch

### Python modules not found
- Activate virtual environment first
- Install dependencies: `pip install -r requirements.txt`

### Permissions denied (Unix/Linux)
- Make script executable: `chmod +x script_name.py`
- Run with python: `python scripts/script_name.py`
