A Django-based multilingual FAQ management system with WYSIWYG editing support and manual translations.
- WYSIWYG editor for FAQ content using CKEditor
- Multi-language support (English, Hindi, Bengali)
- Manual translation management
- REST API with language selection
- Caching for improved performance
- Admin interface for easy content management
- Comprehensive test coverage
- Production-ready Docker configuration
- Backend Framework: Django 5.0.1
- API Framework: Django REST Framework 3.14.0
- Database: SQLite (can be easily switched to PostgreSQL)
- Caching: Django's cache framework with Redis support
- Rich Text Editor: CKEditor
- Testing: pytest with pytest-django
- Containerization: Docker and Docker Compose
- Clone the repository:
git clone https://github.com/yourusername/FAQMaster.git
cd FAQMaster
- Install dependencies:
pip install -r requirements.txt
- Apply migrations:
python manage.py migrate
- Create a superuser:
python manage.py createsuperuser
- Run the development server:
python manage.py runserver
FAQMaster/
├── faq/ # Main app directory
│ ├── models.py # FAQ model with translation support
│ ├── serializers.py # DRF serializers
│ ├── views.py # API views and viewsets
│ └── tests.py # Unit tests
├── faqmaster/ # Project settings
│ ├── settings.py # Development settings
│ └── settings_prod.py # Production settings
├── requirements.txt # Project dependencies
├── Dockerfile # Docker configuration
├── docker-compose.yml # Docker Compose configuration
└── nginx.conf # Nginx configuration for production
- Each FAQ entry stores translations for questions and answers
- Supported languages: English (default), Hindi, Bengali
- Language selection via URL parameter (?lang=hi, ?lang=bn)
- Fallback to English if translation not available
- Cached FAQ lists per language
- Cache invalidation on FAQ updates
- Redis support for production
- Local memory cache for development
- RESTful endpoints following best practices
- Proper status codes and error handling
- Comprehensive response formatting
- Built-in documentation
# Get all FAQs (English by default)
GET /api/faqs/
# Get FAQs in Hindi
GET /api/faqs/?lang=hi
# Get FAQs in Bengali
GET /api/faqs/?lang=bn
Response:
{
"count": 1,
"results": [
{
"id": 1,
"question": "What is this FAQ system?",
"answer": "This is a multilingual FAQ system...",
"created_at": "2024-02-03T12:00:00Z",
"updated_at": "2024-02-03T12:00:00Z"
}
]
}
POST /api/faqs/
Content-Type: application/json
{
"question": "What is this?",
"answer": "This is a FAQ system",
"question_hi": "यह क्या है?",
"answer_hi": "यह एक FAQ सिस्टम है",
"question_bn": "এটা কি?",
"answer_bn": "এটি একটি FAQ সিস্টেম"
}
PUT /api/faqs/{id}/
Content-Type: application/json
{
"question": "Updated question",
"answer": "Updated answer",
"question_hi": "अपडेट किया गया प्रश्न",
"answer_hi": "अपडेट किया गया उत्तर"
}
DELETE /api/faqs/{id}/
The project includes comprehensive tests covering:
- Model functionality
- API endpoints
- Caching mechanism
- Translation features
Run tests with:
python manage.py test
For production deployment instructions, see DEPLOYMENT.md.
- Fork the repository
- Create your 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
- feat: New feature
- fix: Bug fix
- docs: Documentation changes
- test: Adding tests
- refactor: Code refactoring
- style: Code style changes
- chore: Build process or auxiliary tool changes
- Follow PEP 8 guidelines for Python code
- Use meaningful variable and function names
- Add docstrings to functions and classes
- Keep functions small and focused
- Write unit tests for new features
This project is licensed under the MIT License - see the LICENSE file for details.