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.
# first install Python 3.12.x (have not tested newer versions, but they could work)
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 file from .env.example
python3 manage.py migrate # Create empty schema
python3 manage.py runserver
This command creates sample posts.
python3 manage.py import_posts utilities/seed_posts/posts.json
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
coverage run --rcfile=config/.coveragerc -m pytest tests
coverage report -m --skip-covered --rcfile=config/.coveragerc
pytest app
ruff --config ./config/pyproject.toml app
ruff format app
Also see the actions tab to see if everything is passing.
If there are any Ruff failures (badly linted code), the build will fail, so please make sure you have the pre-commit hook installed.
$ cd awesome-django-blog/config
$ pre-commit install
If you want to automatically reload the server whenever you make changes to source code, you can set LIVERELOAD
in the .env 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
- 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.
- 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)
- GitActions CI integration with coverage, linting, and testing. 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 file.
- Procfile included for easy deployment with Heroku or other services that use Procfile.
- Optimized for Performance, SEO, and A11Y
- Latest Django 5.x
- 95% or above unit code coverage for a maintainable codebase
- 100% linted with ruff and PEP8 compliant for beautiful Python code.
- Static scans with CodeQL and 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 test coverage, passing builds, 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 www. prefix and redirect non-www. requests to www.
- HTML minification to reduce page weight and improve load times
Leaflet.js and OpenLayers maps πΊ(Removed in #246)Honeypot Admin page to automatically block IPs trying to login with an admin account(Removed in #105)Ko-Fi donation button βοΈ(removed in https://github.com/jsolly/awesome-django-blog/commit/c857bb7599836c614aff523756bbf1381e0dd948)Post views and likes(Removed in #77)Newsletter Sign up π(removed in #140)Github Integration to show active issue backlog without leaving blog(removed in #121) commit:5c050a5b68d9c8ce7dcf90fdef44377cc28eab6b)Portfolio page with testimonials, contact me, Web vitals, and more!(removed in #404)
We
π 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.
John Solly | Praise Dike |
---|---|
github.com/jsolly |
github.com/freedompraise |
Reach out to me on X!
@_jsolly