A modern Django blog application with unified content management, search functionality, and configurable settings.
- Blog Posts: Create, edit, and publish posts with SEO-friendly URLs
- Personal Posts: Private posts with mood tracking and categories
- Search: Full-text search across posts and content
- Pinning: Pin important posts for quick access
- File Uploads: Attach images and documents to posts
- Settings Management: Configure site name, pagination, and features through admin
- Python 3.8+
- Virtual environment
-
Activate virtual environment
cd SimpleBlog python -m venv venv source ./venv/bin/activate
-
Install dependencies
pip install django pillow
-
Run migrations
python manage.py migrate
-
Create admin user
python manage.py createsuperuser
-
Initialize settings
python manage.py init_settings
-
Start server
python manage.py runserver 0.0.0.0:8000
-
Access the application
- Blog: http://localhost:8000/
- Admin: http://localhost:8000/admin/
- Backend: Django 5.2.4
- Database: SQLite (configurable)
- Frontend: Bootstrap 5, Font Awesome
- Python: 3.x
We may preview the project at https://lufy.org (
Nginx + gunicorn/wsgi/asgi
nginx and gunicorn already installed in operating system.
## simpleblog service file: /etc/systemd/system/simpleblog.service (this is the Rocky linux way, the real location for nginx conf file may up to the OS)
[Unit]
Description=SimpleBlog Gunicorn
After=network.target
[Service]
User=root
Group=nginx
WorkingDirectory=/opt/SimpleBlog/
ExecStart=/venv/bin/gunicorn blog.wsgi:application \
--bind unix:/run/simpleblog.sock \
--workers 2 \
--timeout 120
RuntimeDirectoryMode=775
Restart=always
[Install]
WantedBy=multi-user.target
## nginx config file: /etc/nginx/conf.d/simpleblog.conf
server {
listen <port>; ## replace port to numberic port
server_name <server_name>; ## replace server_name to your domain name
client_max_body_size 16M;
location /static/ {
alias /SimpleBlog/staticfiles/;
}
location /media/ {
alias /SimpleBlog/media/;
}
location / {
proxy_pass http://unix:/run/simpleblog.sock;
}
}
## collect static files
./manage.py collectstatic
## edit blog/settings.py, make followed changes
DEBUG = False ## Set to False to disable django debug feature
CSRF_TRUSTED_ORIGINS = ["<Domain name>"] ## Set the domain name as trusted origin
systemctl start simpleblog
systemctl restart nginx
Open source under MIT License.
Happy Blogging! 📝✨