nwportal/app
OFCNetTracker Django Web Application
A clean, production-ready Django application designed for tracking OFC networks. This project is pre-configured and optimized for hosting on Render using standard blueprints.
๐ Clean Repository Structure
All obsolete configuration folders (Vercel, Netlify, Firebase), diagnostic scripts, logs, and site-package caches have been cleaned up. The repository is organized as a textbook-perfect, lightweight Django structure:
OFCNetTracker/
โโโ nwo_portal/ # Django project root settings and WSGI module
โโโ inventory/ # Primary inventory management Django application
โโโ network/ # Network configuration Django application
โโโ db.sqlite3 # Populated local SQLite database (for local dev)
โโโ render.yaml # Render Blueprint configuration for automatic infrastructure
โโโ build.sh # Unified build script used by Render for deployment
โโโ requirements.txt # Python dependencies for development and production
โโโ manage.py # Django admin CLI entry point
โโโ Dockerfile # Multi-environment container setup (optional fallback)
โโโ .gitignore # Clean git ignore rule set
โโโ README.md # Developer documentation๐ Deployment to Render (Recommended)
Render offers a fully-automated, zero-config deployment path using the included Blueprint spec (render.yaml).
Option 1: Render Blueprint (Automatic & Instant)
- Commit your changes and push the repository to GitHub or GitLab.
- Sign in to the Render Dashboard.
- Click New + and select Blueprint.
- Connect your GitHub/GitLab repository.
- Render will automatically detect the
render.yamlconfiguration and provision: - ๐ A PostgreSQL database (
ofcnet_db) to store production data securely. - โก A Python Web Service (
ofc-net-tracker) with: - Build Command:
./build.sh(automatic package install and static assets processing) - Start Command:
./start.sh(runs database migrations and launches Gunicorn) - Click Approve and let Render automatically build and deploy!
Option 2: Manual Web Service Setup
If you prefer deploying a standalone Web Service manually without a blueprint:
- Click New + -> Web Service in Render.
- Select your repository.
- Configure the following parameters:
- Runtime:
Python 3 - Build Command:
./build.sh - Start Command:
./start.sh - In the Environment Variables tab, add your settings:
DATABASE_URL: Connection string to your production databaseDEBUG:False(for production security)ALLOWED_HOSTS:*or your custom domain nameSECRET_KEY: [Insert a unique random key]
๐ป Local Development Setup
To run and edit the project locally on your machine, follow these steps:
1. Create a Clean Virtual Environment
Open your terminal at the root of the project and execute:
# Create a fresh virtual environment
python -m venv venv
# Activate on Windows (Command Prompt)
venv\Scripts\activate
# Or on Git Bash / macOS / Linux
source venv/bin/activate2. Install Project Dependencies
pip install -r requirements.txt3. Verify Local System & Database
Run Django checks to verify there are no system problems:
python manage.py checkRun database migrations (or verify the local SQLite database state):
python manage.py migrate4. Seed Data (Optional)
If you need to seed or sync database entries, use the provided helper scripts:
python populate_exchanges.py
python populate_data.py
python setup_roles.py5. Launch the Development Server
python manage.py runserverVisit `http://127.0.0.1:8000` in your browser to access the local application.
๐ก๏ธ Production & Performance Features Enabled
- Database Fallback: Automatically connects to the PostgreSQL cloud database in production via
DATABASE_URL, and smoothly falls back to localdb.sqlite3in development. - Static Assets Delivery: Configured with
WhiteNoisefor compressed, highly cached, and lightning-fast delivery of CSS, JavaScript, and asset files. - Security Protocols: Configured to run behind Gunicorn, automatically reads keys from secure Render Environment Variables, and disables Django debug logs in production.
