# Local Dev Tutorial

Use this only for local testing before upload.

If you prefer guided Windows scripts, follow [WINDOWS_SETUP_STEPS.md](C:/--QT%20HOSTABLE--/WINDOWS_SETUP_STEPS.md).

## 1. Open a terminal in the folder

```bash
cd hostable_portal
```

## 2. Create a virtual environment

```bash
python -m venv venv
```

## 3. Activate it

### Windows PowerShell

```powershell
.\venv\Scripts\Activate.ps1
```

### Linux / macOS / cPanel terminal

```bash
source venv/bin/activate
```

## 4. Install requirements

```bash
pip install -r requirements.txt
```

## 5. Create `.env`

Copy `.env.example` to `.env` and change the secret.

If you want a quick random secret value locally:

```bash
python generate_secret_key.py
```

## 6. Create your first admin

```bash
python init_db.py --admin-username admin --admin-email you@example.com --admin-password "ChangeThisNow123!"
```

## 7. Run locally

```bash
python app.py
```

Then open:

```text
http://127.0.0.1:5000/login
```
