A modern Django-based news aggregation platform that fetches and displays news articles from various sources using the NewsAPI.
- 📰 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
- Backend: Django 4.2
- API: Django REST Framework
- Database: SQLite (development), PostgreSQL (production)
- Frontend: HTML, CSS, JavaScript
- External API: NewsAPI
- Deployment: Render, PythonAnywhere compatible
- Python 3.8 or higher
- pip (Python package manager)
- NewsAPI key (get it free at newsapi.org)
- Clone the repository:
git clone https://github.com/yourusername/newssphere.git
cd newssphere- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Set up environment variables:
cp .env.example .envEdit .env and add your configuration:
SECRET_KEY=your-secret-key-here
DEBUG=True
NEWS_API_KEY=your-news-api-key-here
- Run migrations:
python manage.py migrate- Create a superuser (optional):
python manage.py createsuperuser- Run the development server:
python manage.py runserverVisit http://127.0.0.1:8000 in your browser.
- Visit newsapi.org
- Sign up for a free account
- Copy your API key
- Add it to your
.envfile
SECRET_KEY: Django secret key for securityDEBUG: Set toTruefor development,Falsefor productionNEWS_API_KEY: Your NewsAPI keyDATABASE_URL: (Optional) PostgreSQL database URL for production
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
- 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
- Register for an account to save preferences
- Login to access your profile
- Manage your account settings
- Create a new Web Service on Render
- Connect your GitHub repository
- Set environment variables in Render dashboard
- Deploy!
- Upload your code to PythonAnywhere
- Set up a virtual environment
- Configure WSGI file
- Set environment variables
- Reload your web app
See the docs folder for detailed deployment instructions.
The project includes a REST API. See docs/API.md for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
- NewsAPI for providing the news data
- Django community for the excellent framework
- All contributors who help improve this project
If you encounter any issues or have questions, please file an issue on the GitHub repository.
Your Name - @yourusername
Made with ❤️ using Django