Skip to content

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

NewsSphere 🌐

A modern Django-based news aggregation platform that fetches and displays news articles from various sources using the NewsAPI.

Features

  • 📰 Real-time news aggregation from multiple sources
  • 🔍 Search functionality for finding specific news articles
  • 📂 Category-based news browsing
  • 👤 User authentication and profile management
  • 🎨 Clean and responsive UI
  • 🔒 Secure user authentication system
  • 📱 Mobile-friendly design

Tech Stack

  • Backend: Django 4.2
  • API: Django REST Framework
  • Database: SQLite (development), PostgreSQL (production)
  • Frontend: HTML, CSS, JavaScript
  • External API: NewsAPI
  • Deployment: Render, PythonAnywhere compatible

Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)
  • NewsAPI key (get it free at newsapi.org)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/newssphere.git
cd newssphere
  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up environment variables:
cp .env.example .env

Edit .env and add your configuration:

SECRET_KEY=your-secret-key-here
DEBUG=True
NEWS_API_KEY=your-news-api-key-here
  1. Run migrations:
python manage.py migrate
  1. Create a superuser (optional):
python manage.py createsuperuser
  1. Run the development server:
python manage.py runserver

Visit http://127.0.0.1:8000 in your browser.

Configuration

Getting a NewsAPI Key

  1. Visit newsapi.org
  2. Sign up for a free account
  3. Copy your API key
  4. Add it to your .env file

Environment Variables

  • SECRET_KEY: Django secret key for security
  • DEBUG: Set to True for development, False for production
  • NEWS_API_KEY: Your NewsAPI key
  • DATABASE_URL: (Optional) PostgreSQL database URL for production

Project Structure

newssphere/
├── accounts/          # User authentication and profile management
├── news/              # News aggregation and display
├── newssphere/        # Main project settings
├── static/            # Static files (CSS, JS)
├── templates/         # HTML templates
├── docs/              # Documentation
├── manage.py          # Django management script
└── requirements.txt   # Python dependencies

Usage

Browse News

  • Visit the homepage to see the latest news articles
  • Click on categories to filter news by topic
  • Use the search bar to find specific articles

User Features

  • Register for an account to save preferences
  • Login to access your profile
  • Manage your account settings

Deployment

Render

  1. Create a new Web Service on Render
  2. Connect your GitHub repository
  3. Set environment variables in Render dashboard
  4. Deploy!

PythonAnywhere

  1. Upload your code to PythonAnywhere
  2. Set up a virtual environment
  3. Configure WSGI file
  4. Set environment variables
  5. Reload your web app

See the docs folder for detailed deployment instructions.

API Documentation

The project includes a REST API. See docs/API.md for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

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

Acknowledgments

  • NewsAPI for providing the news data
  • Django community for the excellent framework
  • All contributors who help improve this project

Support

If you encounter any issues or have questions, please file an issue on the GitHub repository.

Author

Your Name - @yourusername


Made with ❤️ using Django

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages