Installation
This guide will walk you through installing the SGI Punch Quotation System on your server.
Prerequisites
Before installation, ensure you have:
- Operating System: Linux (Ubuntu 20.04+ recommended)
- Python: Version 3.8 or higher
- Database: SQLite (default) or PostgreSQL
- SAP HANA: Access credentials (optional, for SKU checking)
- Memory: Minimum 2GB RAM
- Storage: Minimum 10GB free space
Step 1: Clone the Repository
git clone https://github.com/ossiek/Punch-SGI-Uploader.git
cd Punch-SGI-Uploader
Step 2: Create Virtual Environment
python3 -m venv venv
source venv/bin/activate
Step 3: Install Dependencies
pip install -r requirements.txt
Main Dependencies
- Django 5.2.8
- openpyxl (Excel file processing)
- WeasyPrint (PDF generation)
- hdbcli (SAP HANA connection)
- python-dotenv (environment variables)
Step 4: Configure Environment Variables
Create a .env file in the project root:
cp .env.example .env
nano .env
Required variables:
# Django Settings
SECRET_KEY=your-secret-key-here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1,your-server-ip
# SAP HANA Connection (Optional)
HANA_HOST=172.16.25.3
HANA_PORT=30015
HANA_USER=your_username
HANA_PASSWORD=your_password
HANA_SCHEMA=SGI_LIVE_HANA
# Microsoft Teams Webhook (Optional)
TEAMS_WEBHOOK_URL=your-webhook-url
Step 5: Initialize Database
python manage.py migrate
Step 6: Create Superuser
python manage.py createsuperuser
Follow the prompts to create an admin account.
Step 7: Create Demo Users
python manage.py setup_users
This creates:
- uploader (password: upload123) - Upload access only
- processor (password: process123) - Full access
Step 8: Initialize System Settings
python manage.py init_settings
This sets up default system configurations.
Step 9: Create Log Directory
mkdir -p logs
chmod 755 logs
Step 10: Run the Server
Development Mode
python manage.py runserver 0.0.0.0:8000
Background Mode (Production)
chmod +x start_server.sh stop_server.sh
./start_server.sh
Verify Installation
- Open your browser and navigate to
http://172.16.1.172:8000 - You should see the login page
- Login with the demo accounts to verify functionality
Post-Installation
Troubleshooting
If you encounter issues during installation:
- Python version: Ensure Python 3.8+ is installed
- Permissions: Check file and directory permissions
- Dependencies: Verify all pip packages installed correctly
- Port conflicts: Ensure port 8000 is not in use
See Common Issues for more help.