CoolFace
Apppublic

nwportal/app

sourceHugging Faceupdated 12d agoView on Hugging Face
0likes
App README

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)

  1. 1.Commit your changes and push the repository to GitHub or GitLab.
  2. 2.Sign in to the Render Dashboard.
  3. 3.Click New + and select Blueprint.
  4. 4.Connect your GitHub/GitLab repository.
  5. 5.Render will automatically detect the render.yaml configuration and provision:
  6. 6.๐Ÿ˜ A PostgreSQL database (ofcnet_db) to store production data securely.
  7. 7.โšก A Python Web Service (ofc-net-tracker) with:
  8. 8.Build Command: ./build.sh (automatic package install and static assets processing)
  9. 9.Start Command: ./start.sh (runs database migrations and launches Gunicorn)
  10. 10.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:

  1. 1.Click New + -> Web Service in Render.
  2. 2.Select your repository.
  3. 3.Configure the following parameters:
  4. 4.Runtime: Python 3
  5. 5.Build Command: ./build.sh
  6. 6.Start Command: ./start.sh
  7. 7.In the Environment Variables tab, add your settings:
  8. 8.DATABASE_URL: Connection string to your production database
  9. 9.DEBUG: False (for production security)
  10. 10.ALLOWED_HOSTS: * or your custom domain name
  11. 11.SECRET_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:

bash
# 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/activate

2. Install Project Dependencies

bash
pip install -r requirements.txt

3. Verify Local System & Database

Run Django checks to verify there are no system problems:

bash
python manage.py check

Run database migrations (or verify the local SQLite database state):

bash
python manage.py migrate

4. Seed Data (Optional)

If you need to seed or sync database entries, use the provided helper scripts:

bash
python populate_exchanges.py
python populate_data.py
python setup_roles.py

5. Launch the Development Server

bash
python manage.py runserver

Visit `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 local db.sqlite3 in development.
  • โ€”Static Assets Delivery: Configured with WhiteNoise for 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.