An intelligent Django-based mentorship platform that connects students with mentors, featuring AI-powered answer generation and multi-language translation capabilities.
- AI Answer Generation: Mentors can generate detailed, comprehensive answers using a pre-trained Qwen language model
- Smart Translation: Real-time translation of questions and answers in multiple languages (English, Chinese, Japanese, Hindi)
- AI Answer Enhancement: Mentors can improve their responses using AI assistance
- Question Management: Post questions with categories (Programming, Career, Project Help, General Learning)
- Real-time Updates: View mentor responses as they arrive
- Multi-language Support: Translate questions and answers to preferred languages
- Progress Tracking: Monitor question status (Pending, Answered, Closed)
- Question Overview: View all student questions with filtering options
- AI-Assisted Responses: Generate or enhance answers using AI
- Translation Tools: Communicate effectively across language barriers
- Student Analytics: Track mentoring activities and statistics
- Django Framework: Modern web framework with robust security
- User Authentication: Role-based access (Student/Mentor)
- Database Persistence: SQLite database for storing questions, answers, and user data
- Responsive Design: Bootstrap for mobile-friendly interface
- AJAX Operations: Seamless user experience without page reloads
mentor/
βββ web/ # Django project root
β βββ manage.py # Django management script
β βββ requirements.txt # Python dependencies
β βββ db.sqlite3 # SQLite database
β βββ projectname/ # Django project settings
β β βββ __init__.py
β β βββ settings.py # Django configuration
β β βββ urls.py # URL routing
β β βββ wsgi.py # WSGI configuration
β β βββ asgi.py # ASGI configuration
β βββ auth/ # Authentication app
β β βββ models.py # Database models (User, Question, Answer)
β β βββ views.py # View controllers and AI integration
β β βββ admin.py # Django admin configuration
β β βββ apps.py # App configuration
β β βββ templates/ # HTML templates
β β β βββ Login.html # Login page
β β β βββ Register.html # Registration page
β β β βββ Student.html # Student dashboard
β β β βββ Mentor.html # Mentor dashboard
β β βββ templatetags/ # Custom template filters
β β β βββ mentor_filters.py
β β βββ migrations/ # Database migrations
β βββ home/ # Home app
β βββ models.py
β βββ views.py
β βββ admin.py
β βββ Templates/ # Home app templates
β β βββ Base.html # Base template
β β βββ Home.html # Landing page
β β βββ About.html # About page
β βββ migrations/
βββ saved_qwen_model/ # Pre-trained AI model (config files only)
β βββ config.json # Model configuration
β βββ tokenizer.json # Tokenizer configuration
β βββ vocab.json # Vocabulary
β βββ ... # Other model config files
βββ translate.ipynb # Translation development notebook
βββ Untitled.ipynb # Additional notebooks
βββ output_audio.mp3 # Audio file
βββ README.md # Project documentation
βββ translate.ipynb # Translation development notebook βββ anaconda_projects/ # Anaconda project files βββ README.md # Project documentation
## π Installation & Setup
### Prerequisites
- Python 3.8+
- Django 5.2
- PyTorch
- Transformers library
### 1. Clone the Repository
```bash
git clone https://github.com/Praharsh7270/Mentor.git
cd Mentor
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatecd web
pip install -r requirements.txtImportant Note: The large AI model file (model.safetensors) is not included in the repository due to GitHub's file size limitations. You will need to:
- Download the Qwen model separately from Hugging Face or another source
- Place the
model.safetensorsfile in thesaved_qwen_model/directory - Ensure all model configuration files are present
Alternatively, you can modify the code to use a different model or implement a different AI solution.
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser # Create admin accountpython manage.py runserverVisit http://127.0.0.1:8000 to access the platform.
- Register/Login as a student
- Post Questions:
- Write clear question titles and descriptions
- Select appropriate categories
- Use translation features if needed
- View Answers:
- Monitor your dashboard for mentor responses
- Translate answers to your preferred language
- Track question status
- Register/Login as a mentor
- Browse Questions:
- View all student questions
- Filter by status and category
- Use translation tools to understand questions in different languages
- Provide Answers:
- Write comprehensive responses
- Use "Answer with AI" for AI-generated responses
- Use "AI Assist" to enhance your existing answers
- Submit answers with real-time updates
The platform integrates a pre-trained Qwen model for:
- Generating detailed mentor responses
- Enhancing existing answers
- Providing context-aware suggestions
- Multi-language support: English, Chinese (δΈζ), Japanese (ζ₯ζ¬θͺ), Hindi (ΰ€Ήΰ€Ώΰ€ΰ€¦ΰ₯)
- Real-time translation of questions and answers
- Context preservation during translation
- UserProfile: Extends Django User with role-based access
- Question: Student questions with categories and status tracking
- Answer: Mentor responses linked to questions
- One-to-Many: User β Questions
- One-to-Many: User β Answers
- One-to-Many: Question β Answers
- Django: Web framework
- SQLite: Database
- PyTorch: AI model framework (if using local model)
- Transformers: Hugging Face library
- Bootstrap: CSS framework
- JavaScript ES6: Dynamic interactions
- AJAX: Asynchronous operations
- Qwen Model: Language model for answer generation (model file not included)
- Custom Translation API: Multi-language support
Create a .env file in the web directory:
SECRET_KEY=your_secret_key_here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1The Qwen model configuration files are in saved_qwen_model/. The large model file (model.safetensors) needs to be downloaded separately due to size constraints.
- Set
DEBUG=Falsein settings - Configure proper database (PostgreSQL recommended)
- Set up static file serving
- Configure ALLOWED_HOSTS
- Use environment variables for sensitive data
# Dockerfile example
FROM python:3.9
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Praharsh7270
- GitHub: @Praharsh7270
- Project Link: https://github.com/Praharsh7270/Mentor
- Hugging Face for the Transformers library
- Qwen model developers
- Django community
- Bootstrap team for the UI framework
If you encounter any issues or have questions:
- Check the Issues section
- Create a new issue with detailed information
- Contact the maintainer
- Large Model File: The
model.safetensorsfile (3.1GB) is not included in this repository due to GitHub's file size limitations - Model Setup: You'll need to download the Qwen model separately or configure an alternative AI solution
- Dependencies: Ensure all Python dependencies are installed as specified in
requirements.txt
β Star this repository if you find it helpful! β