A multilingual FAQ management system built using Django, with features including WYSIWYG editor support, REST API, translation caching, and Docker deployment.
Follow these steps to set up the project locally:
- Python 3.x
- pip (Python package installer)
- Redis (for caching support, optional if not using Redis, but included in Docker setup)
-
Clone the repository:
git clone https://github.com/deekshithatadepalli/faqproject.git
-
Navigate to the project directory:
cd faqproject -
Set up a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- For Windows:
venv\Scripts\activate
- For Mac/Linux:
source venv/bin/activate
- For Windows:
-
Install the required dependencies:
pip install -r requirements.txt
-
Apply database migrations:
python manage.py migrate
-
Create a superuser to access the admin panel:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
The application should now be accessible at http://localhost:8000
The API provides multilingual support for FAQs. Use the lang query parameter to retrieve FAQ questions in the desired language.
- Get FAQs in English (default):
curl http://localhost:8000/api/faqs/
- Get FAQs in Hindi:
curl http://localhost:8000/api/faqs/?lang=hi - Get FAQs in Bengali:
curl http://localhost:8000/api/faqs/?lang=bn
We welcome contributions to improve the project! Here's how you can contribute:
-
Fork the repository:
- Create a personal copy of the project by forking it on GitHub.
-
Create a new branch:
- It is always good practice to work on a new branch rather than directly on
main.
git checkout -b feature-branch
- It is always good practice to work on a new branch rather than directly on
-
Make changes and commit:
git add . git commit -m "Your commit message"
-
Push to your fork and create a pull request:
git push origin feature-branch
- Open a pull request to the main repository.
This project uses Git for version control. To make collaboration easier, we follow conventional commits to ensure a clean commit history.
feat:Adding a new feature.- Example:
feat: Add multilingual FAQ model support
- Example:
fix:Fixing a bug.- Example:
fix: Corrected translation caching issue
- Example:
docs:Updating documentation.- Example:
docs: Update README with API usage examples
- Example:
- Commit Changes Atomically: Each commit should have a single purpose.
- Write Descriptive Commit Messages: Follow the
type: descriptionformat. - Push and Create Pull Requests: Once your changes are committed, push them and create a PR.
To run the application in a Docker container, follow these steps.
# Use an official Python runtime as a parent image
FROM python:3.9-slim
# Set the working directory in the container
WORKDIR /app
# Copy the current directory contents into the container
COPY . /app/
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Expose port 8000 for the Django server
EXPOSE 8000
# Set environment variables for Django
ENV PYTHONUNBUFFERED 1
# Run migrations and start the server
CMD ["sh", "-c", "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"]version: '3'
services:
db:
image: redis:alpine
container_name: redis
ports:
- "6379:6379"
networks:
- backend
web:
build: .
container_name: faqproject_web
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/app
ports:
- "8000:8000"
depends_on:
- db
networks:
- backend
networks:
backend:docker-compose build
docker-compose upAccess the application at http://localhost:8000.
- Install Heroku CLI: Download Here
- Login to Heroku:
heroku login
- Create a new Heroku app:
heroku create faqproject-app
- (Optional) Add Heroku PostgreSQL:
heroku addons:create heroku-postgresql:hobby-dev
- Deploy the application:
git push heroku main
- Open the app:
heroku open
- Set Up an EC2 Instance
- Launch an EC2 instance with a Linux distribution.
- SSH into the instance and install Docker.
- Push Docker Container to AWS ECR
- Build and push the Docker image to Amazon ECR.
- Follow AWS ECR documentation.
- Run the Application on EC2
- SSH into EC2, pull the Docker image, and run the container.