Skip to content

Best Personalized News Platform where user get news according to their interest

Notifications You must be signed in to change notification settings

shahpankaj123/Personalized-News-Recommendation-System-Backend

Repository files navigation


Personalized News Recommendation System Backend

Overview

This project is a Django REST Framework (DRF) backend for a personalized news recommendation system. It provides APIs for managing users, articles, user preferences, and recommendations.

Installation

Follow these steps to set up the project:

  1. Clone the repository:

    git clone https://github.com/shahpankaj123/Personalized-News-Recommendation-System-Backend
  2. Navigate to the project directory:

    cd Personalized-News-Recommendation-System-Backend
  3. Create a virtual environment (optional but recommended):

    python3 -m venv venv
  4. Activate the virtual environment:

    • On Windows:
      venv\Scripts\activate
    • On macOS and Linux:
      source venv/bin/activate
  5. Install dependencies:

    pip install -r requirements.txt
  6. Apply migrations:

    python manage.py migrate
  7. (Optional) Load initial data (e.g., sample articles):

    python manage.py loaddata sample_data.json
  8. Run the development server:

    python manage.py runserver

Configuration

  • Database: This project uses MySQL. Ensure your MySQL database is set up and configured in settings.py.
  • Redis: Used for caching. Ensure Redis is installed and running on your machine.
  • Celery: Used for sending emails and task scheduling.
    • Broker: Redis is used as the message broker for Celery.
    • Beat: Celery Beat is used for scheduling tasks.

Redis Configuration

  1. Install Redis:

    • On macOS:
      brew install redis
    • On Linux:
      sudo apt-get install redis-server
    • On Windows: Follow the instructions on the Redis website.
  2. Start Redis server:

    redis-server

Celery Configuration

  1. Add the following settings in your settings.py:

    # Celery Configuration Options
    CELERY_BROKER_URL = 'redis://localhost:6379/0'
    CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'
    CELERY_ACCEPT_CONTENT = ['json']
    CELERY_TASK_SERIALIZER = 'json'
    CELERY_RESULT_SERIALIZER = 'json'
    CELERY_TIMEZONE = 'UTC'
  2. Start Celery worker and Beat in separate terminal windows:

    # Start Celery worker
    celery -A your_project_name worker --loglevel=info
    
    # Start Celery Beat
    celery -A your_project_name beat --loglevel=info

Contributing

Contributions are welcome! Feel free to open issues or pull requests for any improvements, bug fixes, or new features.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Authors

This project is developed and maintained by:


About

Best Personalized News Platform where user get news according to their interest

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published