
# HAVEN GRAZURI INVESTMENT LIMITED- Media & Static Files Deployment Instructions

## Overview
This document provides instructions for deploying the media and static file fixes to the production server.

## Prerequisites
- Access to the production server via SSH or FTP
- Ability to run Python scripts on the server
- Ability to restart the web server

## Deployment Steps

### 1. Upload the Fix Scripts
Upload the following files to the production server:
- fix_media_images.py
- test_media_access.py
- deploy_media_fix.py

### 2. Run the Deployment Script
```bash
python deploy_media_fix.py
```

### 3. Restart the Web Server
Restart Apache or your web server:
```bash
sudo service apache2 restart
```
Or through cPanel's interface.

### 4. Verify the Fixes
Access the website and verify that:
- Images are loading correctly
- Client names are not overlapping
- Static files (CSS, JS) are loading

## Troubleshooting

### Images Still Not Loading
1. Check file permissions:
   ```bash
   chmod -R 755 media/
   find media/ -type f -exec chmod 644 {} \;
   ```

2. Verify .htaccess is being read:
   Add a test rule to .htaccess and see if it takes effect.

3. Check Apache error logs:
   ```bash
   tail -f /var/log/apache2/error.log
   ```

4. Temporarily enable DEBUG mode:
   Edit branch_system/settings_production.py and set DEBUG = True

### Client Names Still Overlapping
1. Verify the CSS is being loaded:
   Check browser developer tools for 404 errors.

2. Manually add the CSS class to elements:
   Edit the templates to add the 'client-name' class to relevant elements.

## Rollback Plan
If issues persist, you can restore the backup files from the 'backups' directory:
```bash
cp backups/settings_production.py.bak branch_system/settings_production.py
cp backups/urls.py.bak branch_system/urls.py
cp backups/wsgi.py.bak branch_system/wsgi.py
cp backups/.htaccess.bak .htaccess
```

Then restart the web server.
