Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2,333 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Awesome Django Blog

CodeStyle Linting PythonVersion License

Awesome-django-blog is a fully functional blogging platform built using the Django web framework. It includes features such as creating and managing blog posts, comments, and categories, as well as user authentication and authorization.

image


Table of Contents

Installation

# first install Python 3.13.x
git clone https://github.com/jsolly/awesome-django-blog.git
cd awesome-django-blog
python3 -m venv .venv # Create virtual environment
source .venv/bin/activate # Activate virtual environment
pip install -r requirements.txt
python manage.py setup_env # Creates .env.local file from .env.example
python3 manage.py migrate # Create empty schema (if you are using postgres, you need to create the database first. The default database is sqlite3)
python3 manage.py runserver

Seed Posts (Optional)

This command creates sample posts.

python3 manage.py import_posts utilities/seed_posts/posts.json

Default Accounts

The app comes preinstalled with two users. One is an admin and the other can only add comments to posts.

(Username/Password):

  • admin/admin
  • comment_only/comment_only

Development

Coverage

coverage run --rcfile=config/.coveragerc -m pytest tests
coverage report -m --skip-covered --rcfile=config/.coveragerc

Tests

pytest app

Linting

ruff check --config ./config/pyproject.toml app

Formating

ruff format app

Pre-push gate

The quality gate (ruff, collectstatic, migrate, pytest + coverage) runs locally on every push to main via the tracked pre-push hook. Wire it up once per clone:

git config core.hooksPath .git-hooks

The gate logic lives in .git-hooks/pre-push; a failure aborts the push.

Live Reload

If you want to automatically reload the server whenever you make changes to source code, you can set LIVERELOAD in the .env.local file to True. You can learn more about this tool on their GitHub page.

To use livereload, you have to run these commands in TWO SEPARATE terminal windows. Or you can use the included vscode launch.json to run both commands at once.

python3 manage.py runserver
python3 manage.py livereload

Features

Functional Features

  • User profile with avatar (automatic sizing and compression using Pillow)
  • User Login with Django built-in auth to create posts and leave comments
  • Ckeditor 5 for authoring blog posts (also includes spell check, code snippets, character counter, and more!)
  • Add real-time comments without page reloads for a smooth user experience.
  • Slugified URLs for more readable links
  • Open Graph protocol compliant social media sharing for beautiful share cards (LinkedIn, Twitter, Facebook, Instagram, Reddit, etc)
  • Smart and powerful Global search so you can find any blog post with a keyword search.
  • Display site visitors in a web map
  • Light and Dark Theme that automatically switch based on user's current system theme.
  • Blog reading time so viewers can estimate how long it will take them to read a post.
  • Atom and RSS feed so users can subscribe to your latest blog posts.
  • GPT3 powered blog post title, slug, and metadesc generator so you can harness the power of AI in your blog post authoring workflow
  • Copy to clipboard anchor links on every header within a blog post so you can share specific sections of a post.
  • Site-wide 'breadcumbs' so your users can know exactly where they are and navigate with ease.
  • Each page is optimized for viewing (and printing) so break out those 8 1/2 by 11s and print out some content!
  • GPT-powered Chatbot that can answer questions about your blog and help you find content.
  • Related posts at the end of each post detail page so users can quickly navigate to a similar post on your blog.
  • Syntax highlighting with Prism.js for beautiful code blocks in a variety of languages. Also includes line numbers and copy to clipboard functionality. Automatically changes light/dark theme based on user's current system theme.

Non-Functional Features

  • No CSS/Layout frameworks (Bootstrap, Tailwind, etc). All CSS and components are custom and optimized for performance.
  • HTMX for dynamic page updates without a page refresh
  • Robots.txt, security.txt, and sitemap.xml for optimized SEO and security
  • Git hooks for automatic static file generation (manage.py collectstatic)
  • Local pre-push quality gate (lint, collectstatic, migrations, tests + coverage) via .git-hooks/pre-push. Push with confidence!
  • Compatible with Sqllite or postgres databases for fast protyping and production
  • Deploy static assets to Amazon S3 + Cloudfront just by changing a few settings in the .env.local file.
  • Procfile included for easy deployment with Heroku or other services that use Procfile.
  • Optimized for Performance, SEO, and A11Y
  • Latest Django 5.x
  • Unit test coverage measured on every push (coverage.py) for a maintainable codebase
  • 100% linted with ruff and PEP8 compliant for beautiful Python code.
  • pip dependency checks with Dependabot for automated security and updates.
  • Formatted with Ruff for beauty and speed.
  • Strict Content Security Policy preventing inline styles and scripts for better security
  • Subresource Integrity for better security
  • A+ Score on Mozilla Observatory
  • 100/100 for Performance, SEO, and Accessibility according to Google Lighthouse
  • Automatic Conversion of images (.png, .jpeg, etc) to .webp for blazingly fast image loads.
  • Badges for formatter and linting
  • Automated, rotating backups of blog posts using local and cloud storage
  • Status page for monitoring uptime and performance of your blog at https://blogthedata.com/status using Apache Echarts.
  • Custom 404 and 500 pages that look really cool. So even if your users are lost or your app is broke, they are still having a good time.
  • Canonical domain middleware to force . prefix and redirect non-www. requests to www.
  • HTML minification to reduce page weight and improve load times

Depreciated Features

Contributing

We โ™ฅ๏ธ our contributors.

๐Ÿ“• We expect everyone participating in the community to abide by our Code of Conduct. Please read and follow it.
๐Ÿค If you'd like to contribute, start by reading our Contribution Guide.
๐Ÿ‘พ Explore some good first issues.

Let's build great software together.

Top Contributors

John Solly Praise Dike
jsolly freedompraise
github.com/jsolly github.com/freedompraise

Support

Reach out to me on X! @_jsolly


License

License

About

Everything you expect in a blogging platform, and more!

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors

Languages