- JavaScript 32.5%
- CSS 27.5%
- HTML 22.9%
- Python 16.2%
- Shell 0.5%
- Other 0.4%
| django_it_inventory | ||
| inventory | ||
| IT-Inventory@87adbd1eb0 | ||
| static | ||
| staticfiles | ||
| templates/inventory | ||
| .gitattributes | ||
| .gitignore | ||
| deploy.bat | ||
| deploy.sh | ||
| manage.py | ||
| README.md | ||
| requirements.txt | ||
| SECURITY_SETUP.md | ||
| sync_db.sh | ||
Django IT Inventory Management System
A comprehensive IT asset management system built with Django and SQLite, converted from the original Flask/Supabase application.
⚠️ AI-Generated Disclaimer: This application was created with the assistance of AI technology. While the code has been partially reviewed and tested, please ensure it meets your specific security and operational requirements before production use.
🔒 Security Setup
IMPORTANT: This application requires proper security configuration for production use. Please read the SECURITY_SETUP.md guide before deploying.
Quick Security Checklist:
- Create
secrets.txtfile on your server - Generate a new SECRET_KEY for production
- Set DEBUG=False for production
- Configure ALLOWED_HOSTS with your domain
- Use a production database (PostgreSQL/MySQL)
- Enable HTTPS/SSL
- Set proper file permissions (
chmod 600 secrets.txt)
Features
- Asset Management: Complete CRUD operations for IT assets
- Collections: Organize assets into custom collections
- Checkout/Checkin: Track asset assignments and returns
- Search & Filtering: Advanced search across all asset fields
- Statistics Dashboard: Real-time inventory statistics
- Responsive Design: Works on desktop and mobile devices
- Dark Mode: Toggle between light and dark themes
- Django Admin: Full administrative interface
Quick Start
Prerequisites
- Python 3.8 or higher
- pip (Python package installer)
Installation
-
Clone or download the project
cd Django-IT-Inventory -
Install dependencies
pip install -r requirements.txt -
Run migrations
python manage.py migrate -
Populate with sample data (optional)
python manage.py populate_db -
Start the development server
python manage.py runserver -
Access the application
- Open your browser and go to
http://localhost:8000 - Login with:
admin/admin123
- Open your browser and go to
Configuration
Secrets File Template
Create a secrets.txt file in your project root with the following template. Replace the placeholder values with your actual configuration:
# Django IT Inventory - Secrets Configuration
# Copy this template to secrets.txt and fill in your values
# Django Secret Key (REQUIRED)
# Generate a new secret key: python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
SECRET_KEY=your-secret-key-here
# Debug Mode (REQUIRED)
# Set to False for production
DEBUG=True
# Allowed Hosts (REQUIRED for production)
# Add your domain(s) separated by commas
ALLOWED_HOSTS=localhost,127.0.0.1,yourdomain.com
# Database Configuration (OPTIONAL)
# Default uses SQLite. For production, use PostgreSQL or MySQL
# DATABASE_ENGINE=django.db.backends.postgresql
# DATABASE_NAME=your_db_name
# DATABASE_USER=your_db_user
# DATABASE_PASSWORD=your_db_password
# DATABASE_HOST=localhost
# DATABASE_PORT=5432
# Email Configuration (OPTIONAL)
# EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
# EMAIL_HOST=smtp.gmail.com
# EMAIL_PORT=587
# EMAIL_USE_TLS=True
# EMAIL_HOST_USER=your-email@gmail.com
# EMAIL_HOST_PASSWORD=your-app-password
# Static Files Configuration (OPTIONAL)
# STATIC_ROOT=/path/to/static/files
# MEDIA_ROOT=/path/to/media/files
# Security Settings (RECOMMENDED for production)
# SECURE_SSL_REDIRECT=True
# SECURE_HSTS_SECONDS=31536000
# SECURE_HSTS_INCLUDE_SUBDOMAINS=True
# SECURE_HSTS_PRELOAD=True
# SECURE_CONTENT_TYPE_NOSNIFF=True
# SECURE_BROWSER_XSS_FILTER=True
# X_FRAME_OPTIONS=DENY
Important Security Notes:
- Never commit
secrets.txtto version control - Generate a unique SECRET_KEY for each environment
- Set DEBUG=False for production
- Configure ALLOWED_HOSTS with your actual domain(s)
- Use strong passwords and secure database credentials
Default Login Credentials
- Username:
admin - Password:
admin123
Project Structure
Django-IT-Inventory/
├── django_it_inventory/ # Django project settings
├── inventory/ # Main inventory app
│ ├── models.py # Database models
│ ├── views.py # View functions
│ ├── urls.py # URL routing
│ ├── admin.py # Admin interface
│ └── management/ # Custom management commands
├── templates/ # HTML templates
│ └── inventory/
├── static/ # Static files (CSS, JS, images)
├── db.sqlite3 # SQLite database
└── requirements.txt # Python dependencies
Key Features
Asset Management
- Add, edit, delete, and duplicate assets
- Automatic asset code generation (2 letters + 2 numbers)
- Support for all major IT asset categories
- Track serial numbers, models, manufacturers
- Warranty expiration tracking
- Asset condition monitoring
Collections
- Create custom collections to organize assets
- Assign assets to collections
- View collection statistics
Checkout/Checkin System
- Check out assets to users
- Check in returned assets
- Track assignment history
Search & Filtering
- Real-time search across all fields
- Filter by category, status, collection
- Sort by various criteria
- Grid and list view options
Statistics Dashboard
- Total assets count
- Available vs. taken assets
- Maintenance items
- Warranty expiring soon alerts
API Endpoints
The application provides REST API endpoints for AJAX operations:
GET /inventory/api/collections/- List collectionsPOST /inventory/api/collections/- Create collectionDELETE /inventory/api/collections/{id}/- Delete collectionGET /inventory/api/asset/{code}/- Get asset detailsPOST /inventory/api/asset/- Create assetPUT /inventory/api/asset/{code}/- Update assetDELETE /inventory/api/asset/{code}/- Delete assetPOST /inventory/api/checkout/{code}/- Check out assetPOST /inventory/api/checkin/{code}/- Check in asset
Database Models
Inventory Model
asset_code(Primary Key): Unique identifiername: Asset namecategory: Asset category (Desktop, Laptop, etc.)serial_number: Serial numbermodel: Model namemanufacturer: Manufacturerstatus: Current status (Available, Taken, etc.)location: Physical locationassigned_to: Assigned userpurchase_date: Date of purchasewarranty_expires: Warranty expiration datecondition: Asset conditionnotes: Additional notescollection: Associated collection
Collection Model
name: Collection namecreated_at: Creation timestampupdated_at: Last update timestamp
Customization
Adding New Asset Categories
Edit the CATEGORY_CHOICES in inventory/models.py:
CATEGORY_CHOICES = [
('Desktop', 'Desktop'),
('Laptop', 'Laptop'),
# Add your categories here
('New Category', 'New Category'),
]
Modifying Asset Statuses
Edit the STATUS_CHOICES in inventory/models.py:
STATUS_CHOICES = [
('Available', 'Available'),
('Taken', 'Taken'),
# Add your statuses here
('New Status', 'New Status'),
]
Production Deployment
⚠️ SECURITY FIRST: Before deploying to production, you MUST follow the security setup guide.
Essential Security Steps:
- Read SECURITY_SETUP.md - Complete security guide
- Create
secrets.txton your server with production values - Generate new SECRET_KEY - Never use the default!
- Set DEBUG=False in your secrets file
- Configure ALLOWED_HOSTS with your domain
- Set up production database (PostgreSQL recommended)
- Enable HTTPS/SSL certificates
- Set proper file permissions (
chmod 600 secrets.txt)
Additional Production Considerations:
- Configure static file serving (nginx/Apache)
- Set up database backups
- Monitor application logs
- Keep Django and dependencies updated
- Use a reverse proxy for better security
Support
For help or questions, contact: it@twinoaks.org
License
© 2025 Twin Oaks Community
This software is provided as-is for educational and community use. Twin Oaks Community retains all rights to this software.