# Stafflyn Backend cPanel Deployment Guide

Test deployment guide for Stafflyn Django backend on ashemran.shop using cPanel with MySQL database.

**Test URL:** https://ashemran.shop/stafflyn-backend

---

## Pre-Deployment Requirements

- [ ] cPanel hosting account with Python support
- [ ] MySQL database access
- [ ] Domain ashemran.shop configured in cPanel
- [ ] Email configuration via cPanel

---

## 1. Server Setup in cPanel

### 1.1 Create MySQL Database

**Modern cPanel Interface (Recommended):**

1. Log in to cPanel
2. Go to **Manage My Databases** or **Database Wizard**
3. Create a new database:
   - Database Name: `stafflyn_test`
   - Database Type: MySQL
4. Create a new MySQL user:
   - Username: `stafflyn_test`
   - Password: (strong password - 12+ characters)
5. Add the user to the database with ALL privileges

**If using phpMyAdmin (Alternative):**

1. Go to **phpMyAdmin** in cPanel
2. Click **New** on the left sidebar
3. Database name: `stafflyn_test`
4. Collation: `utf8mb4_unicode_ci`
5. Click **Create**
6. Create a new user and grant privileges

**Note:** If you don't see MySQL/Database options in cPanel:
- Contact your hosting provider - MySQL may not be installed
- Ask them which database systems are available (PostgreSQL, SQLite, MariaDB, etc.)
- We can reconfigure the project for the available database

### 1.2 Create Python Application

1. Go to **Setup Python App** in cPanel
2. Create a new Python application:
   - Python version: 3.10 or higher
   - Application root: `/home/[cpanel-username]/public_html/stafflyn-backend`
   - Application startup file: `passenger_wsgi.py`
   - Application entry point: `application`
   - Domain: ashemran.shop

---

## 2. Upload Project Files

### 2.1 Upload via cPanel File Manager (Recommended for Shared Hosting)

1. Log in to cPanel
2. Go to **File Manager**
3. Navigate to `/home/[cpanel-username]/public_html/` directory
4. Create a new folder named `stafflyn-backend`
5. Upload all project files:
   - Extract the project ZIP file or upload each file individually
   - Ensure all Python files (.py), requirements.txt, and app folders are uploaded

### 2.2 Upload via FTP (Alternative)

1. Use an FTP client (FileZilla, WinSCP, etc.)
2. Connect to ashemran.shop with your cPanel credentials
3. Navigate to `/public_html/`
4. Create `stafflyn-backend` folder
5. Upload all project files

### 2.3 Install Python Dependencies (via cPanel Setup Python App)

Python dependencies are automatically installed by cPanel when you create the Python App in section 1.2. The virtual environment and pip install are handled automatically.

If you need to manually update packages:
1. Go to cPanel **Setup Python App**
2. Find your application
3. Click **Edit** → Check installed packages
4. Or use the application's web interface to run pip commands if available

---

## 3. Configure Environment Variables

### 3.1 Create .env File via cPanel File Manager

1. In cPanel **File Manager**, navigate to `/home/[cpanel-username]/public_html/stafflyn-backend/`
2. Create a new file named `.env`
3. Copy the contents from `.env.example`
4. Edit and update with your production values

Or create it manually:
1. Right-click → **Create New File** → Name it `.env`
2. Click **Edit** and paste the configuration below

Edit `.env` with your production values:

```env
# Django Settings
DEBUG=False
SECRET_KEY=your-unique-secret-key-here
ALLOWED_HOSTS=ashemran.shop,www.ashemran.shop

# MySQL Database Configuration
DB_NAME=stafflyn_test
DB_USER=stafflyn_test
DB_PASSWORD=your-secure-db-password
DB_HOST=localhost
DB_PORT=3306

# Email Configuration
EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
EMAIL_HOST=mail.ashemran.shop
EMAIL_PORT=465
EMAIL_USE_TLS=False
EMAIL_USE_SSL=True
EMAIL_HOST_USER=noreply@ashemran.shop
EMAIL_HOST_PASSWORD=your-email-password
DEFAULT_FROM_EMAIL=noreply@ashemran.shop
ADMIN_EMAIL=admin@ashemran.shop

# Frontend URL
FRONTEND_BASE_URL=https://ashemran.shop
```

### 3.2 Generate Secret Key

Use Python's Django secret key generator. You can:

**Option 1:** Visit [Django Secret Key Generator](https://djecrety.ir/) online and copy a generated key

**Option 2:** Run on your local machine:
```bash
python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'
```

**Option 3:** Use OpenSSL (if available):
```bash
openssl rand -base64 32
```

---

## 4. Database Setup

### 4.1 Run Migrations

**If your cPanel has Terminal access** (VPS/Dedicated servers):

```bash
# Navigate to project directory
cd /home/username/stafflyn-backend

# Run migrations
python manage.py migrate
```

**If your cPanel does NOT have Terminal** (Shared Hosting):

Create a migration runner script:

1. In File Manager, create a file: `/home/username/stafflyn-backend/run_migrations.py`
2. Add this code:

```python
import os
import django
from pathlib import Path

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'stafflyn.settings')
BASE_DIR = Path(__file__).resolve().parent

import sys
sys.path.insert(0, str(BASE_DIR))

django.setup()

from django.core.management import call_command
try:
    call_command('migrate')
    print("✓ Migrations completed successfully")
except Exception as e:
    print(f"✗ Migration error: {e}")
```

3. Access it via web browser:
   ```
   https://ashemran.shop/stafflyn-backend/run_migrations.py
   ```

**Alternative:** Use a Python-enabled CGI script or contact your hosting provider for migration assistance.

### 4.2 Create Superuser (Admin)

**If Terminal is available:**

```bash
python manage.py createsuperuser
```

**If Terminal is NOT available:**

Create an admin creation script:

1. Create `/home/username/stafflyn-backend/create_admin.py`:

```python
import os
import django
from pathlib import Path

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'stafflyn.settings')
BASE_DIR = Path(__file__).resolve().parent

import sys
sys.path.insert(0, str(BASE_DIR))

django.setup()

from django.contrib.auth.models import User

# Change these values to your desired admin credentials
username = 'admin'
email = 'admin@yourdomain.com'
password = 'your_secure_admin_password'

if not User.objects.filter(username=username).exists():
    User.objects.create_superuser(username, email, password)
    print(f"✓ Superuser '{username}' created successfully")
else:
    print(f"✗ Superuser '{username}' already exists")
```

2. Edit the script with your admin credentials
3. Access it via browser or contact your host for help

### 4.3 Collect Static Files

Similar to migrations, if Terminal is available:

```bash
python manage.py collectstatic --noinput
```

If not, create a script and execute it. This collects CSS, JavaScript, and image files to `/staticfiles/` directory.

**Note:** cPanel may require you to set directory permissions after collecting static files:
- Ensure `/home/username/stafflyn-backend/staticfiles/` is readable by the web server

---

## 5. Configure Passenger WSGI

### 5.1 Create passenger_wsgi.py

The `passenger_wsgi.py` file is the entry point for cPanel's Passenger application server.

**Using cPanel File Manager:**

1. Go to **File Manager**
2. Navigate to `/home/username/stafflyn-backend/`
3. Click **Create New File** → Name it `passenger_wsgi.py`
4. Right-click → **Edit**
5. Paste the following code:

```python
import os
import sys
from pathlib import Path

# Add project to path
sys.path.insert(0, os.path.dirname(__file__))

# Set Django settings module
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'stafflyn.settings')

# Import Django application
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
```

6. Click **Save**

**Using FTP:**

1. Create `passenger_wsgi.py` on your local machine with the code above
2. Upload it to `/home/username/stafflyn-backend/` via FTP

### 5.2 Verify File Permissions

File permissions are usually handled automatically by cPanel. However, if you encounter issues:

1. Go to File Manager
2. Right-click `passenger_wsgi.py` → **Change Permissions**
3. Set permissions to `644`
4. For directories, set to `755`

**From command line (if Terminal available):**

```bash
chmod 644 passenger_wsgi.py
chmod 755 /home/username/stafflyn-backend
chmod 755 /home/username/stafflyn-backend/stafflyn
```

---

## 6. Configure .htaccess for Proper Routing

Create or edit `.htaccess` file in the project root using cPanel File Manager:

**Using File Manager:**

1. Go to **File Manager** → `/home/username/stafflyn-backend/`
2. Check **Show Hidden Files** option (top menu)
3. If `.htaccess` exists, edit it; otherwise create a new file
4. Click **Create New File** → Name it `.htaccess`
5. Right-click → **Edit** and paste:

```apache
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    
    # Prevent direct access to static/media files through web
    RewriteCond %{REQUEST_URI} ^/(staticfiles|media)/.*$ [NC]
    RewriteRule ^ - [L]
    
    # All other requests go to Django
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ - [L]
</IfModule>
```

**Note:** cPanel typically allows .htaccess modifications. If your host doesn't, contact support.

---

## 7. Restart Application

### 7.1 Restart via cPanel (Recommended)

1. Log in to cPanel
2. Go to **Setup Python App**
3. Find your application in the list
4. Click **Restart** button
5. Wait a few seconds for the application to restart

### 7.2 Restart via File Modification (Alternative)

Some cPanel installations support touch/timestamp-based restart:

1. Go to File Manager
2. Right-click `passenger_wsgi.py`
3. Click **Change Date/Time** and set to current date/time
4. Application will restart automatically

### 7.3 Via Terminal (if available)

```bash
# Method 1: Touch the WSGI file
touch passenger_wsgi.py

# Method 2: Create restart signal
touch tmp/restart.txt
```

---

## 8. Verify Deployment

### 8.1 Check Application Status in cPanel

1. Go to **Setup Python App**
2. Look for your application status (should show "Running")
3. Note the URL assigned (usually yourdomain.com or subdomain)

### 8.2 Check Error Logs

**Via cPanel:**

1. Go to **Error Log** in cPanel
2. Check for Python or Django-related errors
3. Common issues appear here first

**Log file location (if Terminal available):**

```bash
tail -f /home/username/logs/error_log
tail -f /home/username/logs/access_log
```

### 8.3 Test API Endpoints

Open your browser and test:

```
https://ashemran.shop/stafflyn-backend/admin/
```

You should see:
- Django admin login page → ✓ Application is working
- HTTP 500 error → Check error logs in cPanel
- HTTP 502 Bad Gateway → Application hasn't started, check cPanel Setup Python App status

### 8.4 Test Basic Request

```
https://ashemran.shop/stafflyn-backend/api/jobs/
```

Should return JSON response (may be empty array if no jobs) or appropriate API response

---

## 9. Database Backup & Maintenance

### 9.1 Manual Database Backup

**Using cPanel (Recommended):**

1. Log in to cPanel
2. Go to **Manage My Databases** or **Database Wizard**
3. Find `stafflyn_test` in the list
4. Click **Backup** or **Download Backup**
5. Download the SQL file to your computer

**Using phpMyAdmin (if available):**

1. Go to **phpMyAdmin** in cPanel
2. Select `stafflyn_test` database
3. Click **Export**
4. Choose **SQL** format
5. Click **Go** to download

**Via Terminal (if available):**

```bash
mysqldump -u stafflyn_test -p stafflyn_test > backup_$(date +%Y%m%d_%H%M%S).sql
# Enter your database password when prompted
```

### 9.2 Restore Database

**Using phpMyAdmin:**

1. Go to **phpMyAdmin** in cPanel
2. Select `stafflyn_test`
3. Click **Import**
4. Choose your backup SQL file
5. Click **Go**

**Via Terminal (if available):**

```bash
mysql -u stafflyn_test -p stafflyn_test < backup_20260511_120000.sql
# Enter your database password when prompted
```

### 9.3 Schedule Automated Backups

**Using cPanel Backup:**

1. Go to **Backup** in cPanel
2. Configure daily/weekly automated backups
3. cPanel stores backups on the server

**Using cPanel Cron Jobs (if Terminal available):**

1. Go to **Cron Jobs** in cPanel
2. Add a new cron job (daily at 2 AM):

```bash
0 2 * * * /usr/bin/mysqldump -u stafflyn_test -pYOUR_PASSWORD stafflyn_test > /home/[cpanel-username]/backups/backup_$(date +\%Y\%m\%d).sql
```

**Note:** First create `/home/[cpanel-username]/backups/` directory via File Manager

---

## 10. Security Best Practices

### 10.1 Django Security Settings

Ensure in your `.env` file:
- `DEBUG=False` - Always disable debug mode in production
- Use a strong `SECRET_KEY` - Generated during deployment (never commit real key to git)
- `ALLOWED_HOSTS` - Only include your domain and www version
- Never commit `.env` file to git repository

### 10.2 Database Security

- Use a strong MySQL password (12+ characters, mix of letters, numbers, symbols)
- Keep MySQL user credentials in `.env` file only
- Limit database backups access (don't leave backup files in public directories)
- Regularly backup your database (at least weekly)

### 10.3 File Permissions

**Via cPanel File Manager:**

1. Right-click each directory/file
2. Click **Change Permissions**
3. Set:
   - **Directories**: `755` (rwxr-xr-x)
   - **Python files**: `644` (rw-r--r--)
   - **.env file**: `600` (rw-------)  - **Most important**

**Via Terminal (if available):**

```bash
# Directory permissions
chmod 755 -R /home/[cpanel-username]/public_html/stafflyn-backend/stafflyn
chmod 755 -R /home/[cpanel-username]/public_html/stafflyn-backend/job
chmod 755 -R /home/[cpanel-username]/public_html/stafflyn-backend/accounts

# Protect .env file (readable only by owner)
chmod 600 /home/[cpanel-username]/public_html/stafflyn-backend/.env
```

### 10.4 SSL/HTTPS

1. Go to cPanel **AutoSSL** or **SSL/TLS**
2. Install a FREE SSL certificate for ashemran.shop (usually automatic)
3. Verify `ALLOWED_HOSTS` includes ashemran.shop
4. Test SSL at: `https://ashemran.shop`

### 10.5 Hide Sensitive Files

Create `.htaccess` rules to prevent direct access to sensitive files:

```apache
# Add to .htaccess
<Files .env>
    Order allow,deny
    Deny from all
</Files>

<Files "*.py">
    Order allow,deny
    Deny from all
</Files>

<FilesMatch "^\.">
    Order allow,deny
    Deny from all
</FilesMatch>
```

---

## 11. Static Files & Media

### 11.1 Configure Static Files Serving

Static files (CSS, JavaScript, images) are collected to:
```
/home/username/stafflyn-backend/staticfiles/
```

**If you have Terminal access:**

```bash
cd /home/username/stafflyn-backend
python manage.py collectstatic --noinput
```

**If Terminal NOT available:**

Create a collection script (`collect_static.py`):

```python
import os
import django
from pathlib import Path

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'stafflyn.settings')
BASE_DIR = Path(__file__).resolve().parent

import sys
sys.path.insert(0, str(BASE_DIR))

django.setup()

from django.core.management import call_command
try:
    call_command('collectstatic', verbosity=0, interactive=False)
    print("✓ Static files collected successfully")
except Exception as e:
    print(f"✗ Error: {e}")
```

Upload and run via browser.

**Ensure directory is readable by web server:**

1. Go to File Manager
2. Right-click `staticfiles/` folder
3. Change permissions to `755`

### 11.2 Media Files Handling

Media files (user uploads) are stored in:
```
/home/username/stafflyn-backend/media/
```

**Set proper permissions:**

1. Right-click `media/` folder in File Manager
2. Click **Change Permissions**
3. Set to `755` (writable by server)

**Ensure uploads directory exists:**

1. Create `media/` folder in `/home/username/stafflyn-backend/` if it doesn't exist
2. Set permissions to `755`

---

## 12. Email Configuration

### 12.1 Using cPanel Mail Server

**Create an email account:**

1. Go to cPanel **Email Accounts**
2. Create a new email: `noreply@ashemran.shop`
3. Set a strong password
4. Note the email server details

**Update `.env` file:**

Edit your `.env` file in File Manager:

```env
EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
EMAIL_HOST=mail.ashemran.shop
EMAIL_PORT=465
EMAIL_USE_TLS=False
EMAIL_USE_SSL=True
EMAIL_HOST_USER=noreply@ashemran.shop
EMAIL_HOST_PASSWORD=email-password-here
DEFAULT_FROM_EMAIL=noreply@ashemran.shop
ADMIN_EMAIL=admin@ashemran.shop
```

**Find your email server details:**

1. Go to cPanel **Email Accounts**
2. Click your email account
3. Look for **IMAP/POP** or **Mail Settings**
4. Note the server address (usually `mail.ashemran.shop`)

### 12.2 Test Email Configuration

**If Terminal available:**

```bash
python manage.py shell
```

Then in Python shell:

```python
from django.core.mail import send_mail
from django.conf import settings

try:
    send_mail(
        'Test Subject',
        'Test Message Body',
        settings.DEFAULT_FROM_EMAIL,
        ['admin@ashemran.shop'],
        fail_silently=False,
    )
    print("✓ Email sent successfully")
except Exception as e:
    print(f"✗ Email error: {e}")
```

**If Terminal NOT available:**

Create a test email script (`test_email.py`):

```python
import os
import django
from pathlib import Path

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'stafflyn.settings')
BASE_DIR = Path(__file__).resolve().parent

import sys
sys.path.insert(0, str(BASE_DIR))

django.setup()

from django.core.mail import send_mail
from django.conf import settings

try:
    send_mail(
        'Stafflyn Test Email',
        'If you see this, email configuration is working!',
        settings.DEFAULT_FROM_EMAIL,
        ['admin@ashemran.shop'],
        fail_silently=False,
    )
    print("✓ Test email sent successfully")
except Exception as e:
    print(f"✗ Email configuration error: {e}")
```

Upload and run via browser, then check your email.

### 12.3 Using External Email Service

If your cPanel mail isn't reliable, use external services:

**Gmail:**

```env
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USE_TLS=True
EMAIL_HOST_USER=your-email@gmail.com
EMAIL_HOST_PASSWORD=your-app-password
```

**SendGrid or Mailgun:**

Follow their Django configuration documentation and update `.env` accordingly.

---

## 13. Troubleshooting

### 13.1 502 Bad Gateway Error

**Solution:**

1. Check cPanel **Setup Python App** - Status should be "Running"
2. Click **Restart** to restart the application
3. Wait 30-60 seconds for restart to complete
4. Try accessing the site again

**Check error logs:**

1. Go to cPanel **Error Log**
2. Check for Python errors at the bottom
3. Look for "ImportError", "SyntaxError", or permission issues

**Common causes:**

- `passenger_wsgi.py` missing or has syntax error
- `.env` file configuration error
- Module import error (check requirements.txt installed)
- Virtual environment corruption

**Fix:**

1. Delete the Python app in cPanel
2. Recreate it with correct root directory
3. Re-upload `passenger_wsgi.py`
4. Restart application

### 13.2 Database Connection Error

**Error message:** `Can't connect to MySQL server on 'localhost'`

**Solution:**

1. Check MySQL database exists in cPanel **MySQL Databases**
2. Verify `DB_NAME` matches exactly in `.env`
3. Verify MySQL user exists and has privileges
4. Test connection via cPanel **phpMyAdmin**

**Test connection:**

Open cPanel **MySQL Databases** and:
1. Find your database
2. Check **MySQL users with privileges**
3. Ensure your user is listed

### 13.3 Static Files Not Serving (404 errors)

**Solution:**

1. Verify static files collected:

```bash
# Terminal available
python manage.py collectstatic --noinput

# OR check if /staticfiles/ folder exists in File Manager
```

2. Check folder permissions:
   - Right-click `staticfiles/` → **Change Permissions** → `755`

3. Check `.htaccess` doesn't block static access

4. Try accessing directly:
   ```
   https://yourdomain.com/staticfiles/admin/css/base.css
   ```

### 13.4 Permission Denied Errors

**Solution:**

1. Go to File Manager
2. Select problematic directory/file
3. Click **Change Permissions**
4. Set to:
   - **Directories**: `755`
   - **Files**: `644`
   - **.env**: `600`

5. Click **Apply to all** to apply recursively

### 13.5 Module Import Errors

**Error:** `No module named 'mysqlclient'` or similar

**Solution:**

1. Check dependencies installed in cPanel **Setup Python App**
2. Go to cPanel **Setup Python App**
3. Click **Edit**
4. Ensure virtual environment has dependencies

**Reinstall packages:**

If available via cPanel tools, or create requirements installer script and run via browser.

### 13.6 Email Not Sending

**Solution:**

1. Check email account exists in cPanel **Email Accounts**
2. Verify credentials in `.env` are correct
3. Test email manually:
   - Create `test_email.py` with test code
   - Run via browser or Terminal
   - Check email received

4. Check firewall/outgoing mail isn't blocked:
   - Contact hosting provider if emails don't send

5. Try using external email service (Gmail, SendGrid) instead

### 13.7 Application Shows "Loading" Forever

**Solution:**

1. Check cPanel **Error Log** for timeouts or Python errors
2. May be taking long to process first request
3. Wait 2-3 minutes for database migrations to complete
4. Restart application via cPanel

### 13.8 Changes to .env Not Taking Effect

**Solution:**

1. After editing `.env`, **restart** the application:
   - Go to cPanel **Setup Python App**
   - Click **Restart**

2. Wait 30 seconds
3. Reload website in browser
4. Clear browser cache if needed (Ctrl+Shift+Delete)

---

## 14. Post-Deployment Checklist

Before announcing your site is live:

- [ ] Database `stafflyn_test` created in cPanel MySQL
- [ ] `.env` file configured with test values
- [ ] `DEBUG=False` in settings
- [ ] `SECRET_KEY` is unique and strong
- [ ] `ALLOWED_HOSTS` includes ashemran.shop
- [ ] `passenger_wsgi.py` created in project root
- [ ] Static files collected
- [ ] Static files permissions set to `755`
- [ ] Media folder created with `755` permissions
- [ ] `.env` file permissions set to `600`
- [ ] SSL certificate installed for ashemran.shop
- [ ] Admin panel accessible at `/stafflyn-backend/admin/`
- [ ] Email configuration tested
- [ ] API endpoints responding with JSON
- [ ] Error logs checked (no critical errors)
- [ ] Database backups configured
- [ ] `.htaccess` properly configured

---

## 15. Monitoring & Maintenance

### 15.1 Regular Monitoring

**Weekly:**
- Check cPanel **Error Log** for issues
- Verify backups are running
- Test admin panel login

**Monthly:**
- Review `stafflyn_test` database size in **Manage My Databases**
- Test database restore procedure
- Check for any 500 errors in cPanel Error Log

### 15.2 Regular Backups

**Set up automated backups:**

1. Go to cPanel **Backup**
2. Configure daily or weekly backups
3. Keep backups for at least 30 days
4. Test restoring from backup monthly

**Manual backup:**
1. Go to **Manage My Databases**
2. Download `stafflyn_test` backup
3. Store in safe location

### 15.3 Python/Django Updates

**Check for security updates:**

1. Monitor Django security releases at https://www.djangoproject.com/weblog/
2. Monitor MySQL security updates via cPanel

**Update steps:**

If Terminal available, can update packages. Otherwise:
1. Create requirements update script
2. Test on backup/development first
3. Update live site
4. Restart application via cPanel

### 15.4 Security Monitoring

**Monthly security checks:**

- [ ] Check `.env` file not in git repository
- [ ] Verify `DEBUG=False`
- [ ] Check file permissions (especially `.env`)
- [ ] Review user accounts in Django admin
- [ ] Check for suspicious email sends in logs
- [ ] Verify SSL certificate is valid

### 15.5 Performance Monitoring

**cPanel Performance Tools:**

1. Go to **CPU and Concurrent Connection Usage**
2. Monitor resource usage
3. If consistently high, may need upgrade

**Database optimization:**

Via cPanel **phpMyAdmin**:
1. Select database
2. Click **Maintenance**
3. Optimize tables regularly

---

## 16. Getting Help

If you encounter issues:

1. **Check Error Logs First:**
   - cPanel **Error Log** for web errors
   - cPanel **MySQL Databases** for database issues

2. **Contact Hosting Provider:**
   - They can help with cPanel, MySQL, Python installation
   - Ask about Terminal/SSH access availability

3. **Django Documentation:**
   - https://docs.djangoproject.com/
   - https://docs.djangoproject.com/en/stable/howto/deployment/

4. **Get Community Help:**
   - Stack Overflow with tag `django`
   - Django Forum at https://forum.djangoproject.com/

5. **This Project:**
   - Check README.md for project-specific setup
   - Review API documentation in `/docs/` folder

---

## 11. API Endpoints Available

Base URL: `https://backend.stafflyn.com`

### Jobs API
- `GET /api/jobs/` - List all jobs
- `GET /api/jobs/{slug}/` - Job details (by slug)
- `POST /api/jobs/` - Create new job
- `GET /api/sitemap/` - Sitemap data

### SEO/Schema
- `GET /api/schema/job/{slug}/` - Job schema (JSON-LD)
- `GET /api/schema/blog/{slug}/` - Blog schema
- `GET /api/schema/organization/` - Organization schema

### Admin
- `https://backend.stafflyn.com/admin/` - Django admin panel

---

## Support & Documentation

- API Documentation: See `docs/API_DOCUMENTATION.md`
- Frontend Integration: See `docs/NEXT_JS_SEO_README.md`
- Docker Setup: See `DOCKER_SETUP.md`

---

**Last Updated:** May 7, 2026
**Backend URL:** https://backend.stafflyn.com
