Skip to content

🏘 Django πŸͺ Online πŸ•Œ Newspaper 🚝 is a full πŸš‚ featured πŸšƒ news 🏦 publishing πŸ₯ and 🏰 content πŸš… management πŸš‹ system built ✈ with Django πŸš€ It allows 🚟 admins 🚁 editors and πŸ›Έ contributors πŸ›Ά to manage β›± articles πŸ” categories 🍎 and users 🍏 while providing πŸ‘ readers with πŸ«‘ a smooth πŸ«– and πŸ«’ responsive πŸ‹ news🍿consumption πŸ₯£ experience

Notifications You must be signed in to change notification settings

Hazrat-Ali9/Django-Online-Newspaper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“° Django Online Newspaper

A modern, feature-rich online newspaper platform built with Django. This application allows users to read news articles, rate them, and provides an editorial system for content management.

✨ Features

πŸ” Core Features

  • News Articles: Browse and read news articles organized by categories
  • Rating System: Users can rate articles (0-4 stars) with comments
  • Category Management: News organized by different categories
  • User Authentication: Registration, login, and profile management
  • Editorial System: Special editor accounts for content creation
  • Responsive Design: Mobile-friendly interface using Bootstrap 5

πŸ‘₯ User Roles

  • General Users: Can read articles, rate them, and manage their profiles
  • Editors: Can create, edit, and publish news articles
  • Administrators: Full access to manage users, categories, and content

πŸ“Š Advanced Features

  • Article Views Tracking: Monitor article popularity
  • Editor Performance: Track editor statistics and ratings
  • Image Upload: Support for article images
  • Search & Filter: Browse articles by category
  • Admin Dashboard: Comprehensive admin interface

πŸ› οΈ Technology Stack

  • Backend: Django 4.2.5
  • Frontend: HTML5, CSS3, Bootstrap 5, JavaScript
  • Database: SQLite (default) / PostgreSQL (production ready)
  • Forms: Django Crispy Forms with Bootstrap 5
  • Image Processing: Pillow
  • Styling: Custom CSS + Bootstrap 5

πŸ“‹ Prerequisites

  • Python 3.7 or higher
  • pip (Python package installer)
  • Git (for cloning the repository)

πŸš€ Quick Start

Option 1: Automated Setup (Recommended)

  1. Clone the repository

    git clone <repository-url>
    cd django-online-newspaper-main
  2. Run the setup script

    python setup.py
  3. Start the server

    python run.py

Option 2: Manual Setup

  1. Clone and navigate to the project

    git clone <repository-url>
    cd django-online-newspaper-main
  2. Create a virtual environment (recommended)

    python -m venv newspaper_env
    source newspaper_env/bin/activate  # On Windows: newspaper_env\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Run database migrations

    python manage.py makemigrations
    python manage.py migrate
  5. Collect static files

    python manage.py collectstatic
  6. Create a superuser account

    python manage.py createsuperuser
  7. Start the development server

    python manage.py runserver

🌐 Access Points

πŸ“ Project Structure

django-online-newspaper-main/
β”œβ”€β”€ πŸ“ accounts/              # User management app
β”‚   β”œβ”€β”€ πŸ“ migrations/        # Database migrations
β”‚   β”œβ”€β”€ πŸ“ templates/         # Account-related templates
β”‚   β”œβ”€β”€ models.py            # User and Editor models
β”‚   β”œβ”€β”€ views.py             # Account views
β”‚   β”œβ”€β”€ forms.py             # User forms
β”‚   └── urls.py              # Account URLs
β”œβ”€β”€ πŸ“ posts/                 # News articles app
β”‚   β”œβ”€β”€ πŸ“ migrations/        # Database migrations
β”‚   β”œβ”€β”€ πŸ“ templates/         # Post-related templates
β”‚   β”œβ”€β”€ models.py            # Post, Category, Rating models
β”‚   β”œβ”€β”€ views.py             # Post views
β”‚   β”œβ”€β”€ forms.py             # Post forms
β”‚   └── urls.py              # Post URLs
β”œβ”€β”€ πŸ“ Newspaper_Site/        # Main project settings
β”‚   β”œβ”€β”€ settings.py          # Django settings
β”‚   β”œβ”€β”€ urls.py              # Main URL configuration
β”‚   β”œβ”€β”€ views.py             # Main views
β”‚   └── wsgi.py              # WSGI configuration
β”œβ”€β”€ πŸ“ templates/             # Global templates
β”œβ”€β”€ πŸ“ static/                # Static files (CSS, JS, images)
β”œβ”€β”€ πŸ“ media/                 # User uploaded files
β”œβ”€β”€ πŸ“ staticfiles/           # Collected static files
β”œβ”€β”€ db.sqlite3               # SQLite database
β”œβ”€β”€ manage.py                # Django management script
β”œβ”€β”€ requirements.txt         # Python dependencies
β”œβ”€β”€ setup.py                 # Automated setup script
β”œβ”€β”€ run.py                   # Quick run script
└── README.md                # This file

🎯 Usage Guide

For General Users

  1. Registration: Create an account at /accounts/register/
  2. Login: Access your account at /accounts/login/
  3. Browse News: View articles on the homepage organized by categories
  4. Rate Articles: Click "Give Rating" on any article to rate and comment
  5. View Details: Click "Details" to read the full article
  6. Profile Management: Update your profile information

For Editors

  1. Apply for Editor Role: Submit an application through the accounts section
  2. Wait for Approval: Admin needs to approve your editor application
  3. Create Articles: Once approved, create and publish news articles
  4. Manage Content: Edit your published articles
  5. Track Performance: View your editor statistics and ratings

For Administrators

  1. Access Admin Panel: Visit /admin/ with superuser credentials
  2. Manage Users: Approve editor applications, manage user accounts
  3. Content Management: Oversee all articles and categories
  4. System Monitoring: Track site statistics and user activity

πŸ”§ Configuration

Environment Variables

Create a .env file based on .env.example:

cp .env.example .env

Edit the .env file with your specific configuration:

SECRET_KEY=your-secret-key-here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1

Database Configuration

SQLite (Default)

  • No additional configuration needed
  • Database file: db.sqlite3

PostgreSQL (Production)

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'newspaper_db',
        'USER': 'your_username',
        'PASSWORD': 'your_password',
        'HOST': 'localhost',
        'PORT': '5432',
    }
}

πŸ“Š Models Overview

User Management

  • ApplicationsForEditors: Editor application requests
  • EditorsProfile: Editor profile information
  • User: Django's built-in user model (extended)

Content Management

  • Category: News categories (Sports, Politics, Technology, etc.)
  • Post: News articles with metadata
  • Rating: User ratings and comments for articles

🎨 Customization

Styling

  • Main CSS: static/css/style.css
  • Bootstrap 5 integration
  • Responsive design for mobile devices

Templates

  • Base template: templates/base.html
  • Account templates: accounts/templates/
  • Post templates: posts/templates/

πŸš€ Deployment

Development

python manage.py runserver

Production Checklist

  • Set DEBUG = False
  • Configure proper database (PostgreSQL recommended)
  • Set up static file serving
  • Configure email backend
  • Set up proper logging
  • Use environment variables for sensitive data
  • Set up SSL/HTTPS
  • Configure allowed hosts

🀝 Contributing

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

πŸ“ License

This project is open source and available under the MIT License.

πŸ› Troubleshooting

Common Issues

Migration Errors

python manage.py makemigrations --empty accounts
python manage.py makemigrations --empty posts
python manage.py migrate

Static Files Not Loading

python manage.py collectstatic --clear

Permission Errors

chmod +x setup.py run.py

Getting Help

πŸ“ž Support

For support and questions:

  • Create an issue in the repository
  • Check existing documentation
  • Review the troubleshooting section

Happy Coding! πŸŽ‰

Built with ❀️ using Django and Bootstrap

About

🏘 Django πŸͺ Online πŸ•Œ Newspaper 🚝 is a full πŸš‚ featured πŸšƒ news 🏦 publishing πŸ₯ and 🏰 content πŸš… management πŸš‹ system built ✈ with Django πŸš€ It allows 🚟 admins 🚁 editors and πŸ›Έ contributors πŸ›Ά to manage β›± articles πŸ” categories 🍎 and users 🍏 while providing πŸ‘ readers with πŸ«‘ a smooth πŸ«– and πŸ«’ responsive πŸ‹ news🍿consumption πŸ₯£ experience

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published