Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

Β 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“° Blog Project β€” Django News Platform

A full-featured, multi-language news & blog web application built with Django 5.2 and Python 3.13. Users can browse categorized news, read articles, comment, and manage content β€” all in Uzbek, Russian, and English.


πŸš€ Features

  • News Feed β€” Latest published articles displayed on the homepage, sorted by publish time
  • Category Filtering β€” Filter news by categories: Mahalliy (Local), Xorij (Foreign), Sport, Texnalogiya (Technology)
  • Article Detail Page β€” Full article view with hit/view counter powered by django-hitcount
  • Comment System β€” Authenticated users can post comments on articles
  • Search β€” Full-text search across article titles and body content using Django Q objects
  • User Authentication β€” Register, login, logout with Django's built-in auth system
  • User Profile β€” Profile page with photo upload and date of birth
  • Profile Editing β€” Users can update their personal info and profile picture
  • CRUD for News β€” Create, edit, and delete articles (permission-protected)
  • Admin Panel β€” Superuser-only admin page listing all admin accounts
  • Multi-language Support β€” Full i18n with Uzbek (default), Russian, and English via django-modeltranslation and i18n_patterns
  • Contact Form β€” Users can send messages through a contact page
  • Password Management β€” Change password, reset password via email flow
  • Draft / Published Status β€” Articles have Draft/Published states; only published articles are visible publicly
  • Custom Manager β€” PublishedManager filters only published news across all queries
  • Custom Permissions β€” OnlyLoggedUserMixin restricts CRUD views to authenticated users
  • Context Processor β€” Latest news injected globally into all templates
  • Responsive Design β€” Bootstrap-based frontend with jQuery, Slick slider, WOW.js animations, and FancyBox

πŸ› οΈ Tech Stack

Layer Technology
Language Python 3.13
Framework Django 5.2
Database SQLite3 (dev)
ORM Django ORM
Auth Django Built-in Auth
Image Handling Pillow
Hit Counter django-hitcount
Multi-language django-modeltranslation, Django i18n
Frontend HTML5, CSS3, Bootstrap, jQuery
JS Libraries Slick.js, WOW.js, FancyBox, jQuery NewsTicker
Package Manager Pipenv
IDE Config PyCharm (.idea)

πŸ“ Project Structure

Blog_project/
β”œβ”€β”€ config/                  # Project settings & root URL config
β”‚   β”œβ”€β”€ settings.py
β”‚   β”œβ”€β”€ urls.py              # i18n_patterns + app routing
β”‚   └── wsgi.py
β”‚
β”œβ”€β”€ news_app/                # Core news application
β”‚   β”œβ”€β”€ models.py            # News, Category, Comment, Contact models
β”‚   β”œβ”€β”€ views.py             # Function & class-based views
β”‚   β”œβ”€β”€ urls.py              # News URL patterns
β”‚   β”œβ”€β”€ forms.py             # ContactForm, CommentForm
β”‚   β”œβ”€β”€ admin.py             # Admin registrations
β”‚   β”œβ”€β”€ translation.py       # modeltranslation field declarations
β”‚   β”œβ”€β”€ context_processor.py # Global latest news context
β”‚   └── custom_permissions.py
β”‚
β”œβ”€β”€ accounts/                # User auth & profile app
β”‚   β”œβ”€β”€ models.py            # Profile model (OneToOne with User)
β”‚   β”œβ”€β”€ views.py             # Login, register, profile, edit views
β”‚   β”œβ”€β”€ forms.py             # LoginForm, RegisterForm, EditForms
β”‚   └── urls.py
β”‚
β”œβ”€β”€ templates/               # All HTML templates
β”‚   β”œβ”€β”€ news/                # Home, detail, category, search pages
β”‚   β”œβ”€β”€ account/             # Register, profile edit pages
β”‚   β”œβ”€β”€ registration/        # Login, logout, password reset pages
β”‚   β”œβ”€β”€ crud/                # Create, edit, delete news pages
β”‚   └── pages/               # User profile, admin page
β”‚
β”œβ”€β”€ static/                  # CSS, JS, fonts, images
β”œβ”€β”€ media/                   # Uploaded news images & user photos
β”œβ”€β”€ manage.py
└── Pipfile

βš™οΈ Installation & Setup

1. Clone the repository

git clone https://github.com/aziz-200/Blog_project.git
cd Blog_project

2. Install dependencies

pip install pipenv
pipenv install
pipenv shell

3. Apply migrations

python manage.py migrate

4. Create a superuser

python manage.py createsuperuser

5. Run the development server

python manage.py runserver

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


🌍 Multi-language Support

The app supports 3 languages: Uzbek (uz β€” default), Russian (ru), and English (en).

Language switching is handled via Django's i18n_patterns and the /i18n/ URL endpoint. Article titles and bodies have translated fields managed by django-modeltranslation.


πŸ“¦ Dependencies

django==5.2
pillow
django-hitcount
django-modeltranslation
python==3.13

Install all with:

pipenv install

πŸ” Authentication & Permissions

  • Public users can browse and read news
  • Only logged-in users can post comments or access CRUD views
  • Only superusers can access the admin page (/adminpage/)
  • Password reset is handled via console email backend (configure SMTP for production)

πŸ“Œ URL Overview

URL View Description
/ HomePageView Homepage with latest news
/news/ news_list All published news
/news/<slug>/ news_detail Single article + comments
/news/<slug>/edit/ NewsUpdateView Edit article (auth required)
/news/<slug>/delete/ NewsDeleteView Delete article (auth required)
/new/create/ NewsCreateView Create article (auth required)
/mahalliy/ LocalNewsView Local news category
/xorij/ XorijNewsView Foreign news category
/sport/ SportNewsView Sports news category
/texnalogiya/ TechnologyNewsView Technology news category
/searchResult/?q= SearchResultsListView Search results
/contact-us/ ContactPageView Contact form
/account/ accounts app Register, login, profile, edit
/adminpage/ admin_page_view Superuser admin page

πŸ—„οΈ Data Models

News

  • title, slug, body, image, category, publish_time, status (Draft/Published)
  • Custom PublishedManager to filter only published articles
  • Translated fields: title_uz, title_ru, body_uz, body_ru

Category

  • name β€” e.g. Mahalliy, Xorij, Sport, Texnalogiya

Comment

  • Linked to News and User via ForeignKey
  • body, created_time, active flag

Profile

  • OneToOne with Django User
  • photo, date_of_birth

Contact

  • name, email, message

πŸ“ License

This project is licensed under the terms in the LICENSE file.


πŸ‘€ Author

Aziz β€” github.com/aziz-200

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages