A Django-based Call Detail Record (CDR) Reporting Service that:
- Filters CDRs by date range & project.
- Displays a full CDR report with all columns.
- Exports data to CSV.
- Visualizes SIP reason distribution using a pie chart.
- Runs inside Docker with PostgreSQL support.
- π Django CDR Reporting Service
- π Table of Contents
- π Full CDR Reporting with all fields.
- π Filter by Date & Project Schema.
- π Export to CSV.
- π³ Runs in Docker with PostgreSQL.
- Stores:
- User auth & admin accounts
- Project schema connection info
- UI configuration
- Filtered queries
- Stores CDR data per project.
- Each project gets its own table under the same schema:
- Table name = project
schema
field
- Table name = project
- Populated by a separate Go service at the end of each day.
- Polls all registered project databases.
- Aggregates daily CDR records.
- Imports the data into
central_data
under a table named after the project schema. - Django UI queries from these tables on demand.
git clone https://github.com/yourusername/django-cdr-service.git
cd django-cdr-service
python -m venv venv
source venv/bin/activate # macOS/Linux
venv\Scripts\activate # Windows
pip install -r requirements.txt
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
Then, visit http://localhost:8000.
docker build -t django-cdr .
docker run -p 8000:8000 django-cdr
docker-compose up -d --build
- Uses PostgreSQL (default) or MySQL.
- Set variables in .env or docker-compose.yml.
Example .env
file:
# Main database
DB_NAME=billsec_portal
DB_USER=billsec_portal
DB_PASSWORD=billsec_portal
DB_HOST=localhost
DB_PORT=5432
# Data Central for store cdr
DC_DB_NAME=data_central
DC_DB_USER=data_central
DC_DB_PASSWORD=data_central
DC_DB_HOST=localhost
DC_DB_PORT=2345
Edit settings.py:
DATABASES = {
'default': dj_database_url.config(default=os.getenv('DATABASE_URL'))
}
The report supports:
- Date Range Selection (From & To).
- Project Schema Selection.
- Full Table Display (All Fields).
- CSV Export.
- Django (Python)
- PostgreSQL (Database)
- Gunicorn (Production WSGI Server)
- Docker & Docker Compose (Containerization)
Method | Endpoint | Description |
---|---|---|
GET | /cdr | View full CDR report |
POST | /cdr/export | Export report as CSV |
GET | /projects | Manage Projects |
GET | /billing | View Fare Report |
- Fork & Clone the Repo.
- Set up a virtual environment.
- Submit a Pull Request with improvements.
- π₯ CDR Data Import (SFTP, API).
- π Advanced Analytics & Charts.
- π Live CDR Updates.
For issues, create a GitHub issue or contact [email protected]
.
π Enjoy your fully Dockerized Django CDR Reporting Service! π