A comprehensive cybersecurity platform built with Django that provides AI-powered threat detection for URLs, emails, SMS messages, and documents.
- URL Analysis: Detect phishing sites and malicious URLs
- Email Security: Identify spam and phishing emails
- SMS Detection: Analyze SMS messages for smishing attacks
- Document Security: Scan PDF and text files for threats
- User registration and authentication
- Personal dashboard with security statistics
- Profile management with additional details
- Activity tracking and history
- Built-in security assistant
- Real-time threat analysis
- Security tips and guidance
- Powered by Google Gemini AI
- Detection result history
- User activity logging
- Security statistics
- Confidence scoring
- Backend: Django 5.0.2
- Database: SQLite (can be configured for PostgreSQL/MySQL)
- AI/ML: Google Gemini AI, Custom ML models
- Frontend: HTML, CSS, JavaScript
- Styling: Custom cybersecurity theme
- File Processing: PyPDF2 for PDF analysis
- Python 3.8+
- pip package manager
-
Clone the repository
git clone <repository-url> cd cyberguard-django
-
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables Create a
.envfile in the project root:google_api_key=your_google_gemini_api_key_here SECRET_KEY=your_django_secret_key_here -
Run database migrations
python manage.py makemigrations python manage.py migrate
-
Create superuser (optional)
python manage.py createsuperuser
-
Run the development server
python manage.py runserver
-
Access the application
- Main site: http://localhost:8000
- Admin panel: http://localhost:8000/admin
cyberguard_django/
├── cyberguard_django/ # Main project settings
├── main_app/ # Core application
│ ├── models.py # Detection and activity models
│ ├── views.py # Main views and detection logic
│ ├── forms.py # Detection forms
│ ├── urls.py # URL routing
│ └── admin.py # Admin configuration
├── user_auth/ # User authentication app
│ ├── models.py # User profile model
│ ├── views.py # Auth views
│ ├── forms.py # User forms
│ ├── urls.py # Auth URL routing
│ └── admin.py # User admin
├── templates/ # HTML templates
│ ├── base.html # Base template
│ ├── main_app/ # Main app templates
│ └── user_auth/ # Auth templates
├── static/ # Static files
│ └── css/
│ └── style.css # Main stylesheet
├── media/ # User uploaded files
├── requirements.txt # Python dependencies
└── manage.py # Django management script
- Register/Login: Create an account or sign in
- Dashboard: View your security statistics and recent activity
- Security Tools:
- URL Detection: Paste suspicious URLs for analysis
- Email Security: Analyze email content for threats
- SMS Detection: Check SMS messages for smishing
- File Analysis: Upload PDF/TXT files for scanning
- Chatbot: Use the security assistant for guidance
- Admin Panel: Access at
/admin - User Management: Monitor user accounts and activities
- Detection Results: View all security scans and results
- Analytics: Track system usage and threat patterns
GET /- Home pageGET /url-detection/- URL analysis pageGET /email-detection/- Email analysis pageGET /sms-detection/- SMS analysis pageGET /file-analysis/- File analysis pageGET /about/- About pageGET /contact/- Contact pagePOST /chatbot/- AI chatbot APIGET /auth/signup/- User registrationGET /auth/login/- User loginGET /auth/profile/- User profileGET /auth/dashboard/- User dashboard
- CSRF Protection: All forms protected against CSRF attacks
- User Authentication: Secure login/logout system
- File Upload Security: Validated file types and sizes
- Input Validation: All user inputs are validated
- Activity Logging: Track user activities for security
- Secure Headers: Django security middleware enabled
- Modify
static/css/style.cssfor theme changes - Update color variables in CSS root for branding
- Extend
DetectionResultmodel for additional detection types - Add fields to
UserProfilefor more user information
- Customize detection logic in
main_app/views.py - Add new security features as needed
- Set
DEBUG = Falsein settings - Configure production database (PostgreSQL recommended)
- Set up static file serving
- Configure environment variables
- Use HTTPS in production
- Heroku: Easy deployment with PostgreSQL
- DigitalOcean: VPS with Django deployment
- AWS: EC2 with RDS database
- Google Cloud: App Engine or Compute Engine
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Email: security@cyberguard.com
- Documentation: Check the admin panel for detailed guides
- Issues: Use the GitHub issues page
- Google Gemini AI for chatbot functionality
- Django community for the excellent framework
- Cybersecurity community for threat intelligence