I made a reusable blog application using Django. It is really simple.
It does tagging, rss, ckeditor rich text entry with image uploads, slugged urls and that’s about it.
No comments, no social integration, no trackbacks.
It is pretty customisable though because I’m be using it for two very different blogs.
Install
All within a Django project:
Add to INSTALLED_APPS:
INSTALLED_APPS = (
...
'ckeditor',
'rsbp',
)
Configure ckeditor:
from rsbp.ck_settings import RSBP_CKEDITOR_CONFIG
CKEDITOR_UPLOAD_PATH = os.path.join(MEDIA_ROOT, 'uploads')
CKEDITOR_CONFIGS = {
'rsbp': RSBP_CKEDITOR_CONFIG,
}
Customise
Probably the first things you’ll want to do are:
Tweak the templates a bit, you’ll probably want to start with templates/rsbp/includes/footer.html
Tweak the default settings:
- RSBP_IMAGE_UPLOAD_DIR
Will be appended to your media directory, default: “uploads”
- RSBP_POSTS_PER_PAGE
How many posts show per page, default: 5
- RSBP_FEED_TITLE
The title of your rss feed, default: “Blog”
- RSBP_FEED_LINK
The default link for the rss feed, default: “/”
- RSBP_FEED_DESCRIPTION
The description of your blog for the rss feed, default: “”
- RSBP_FEED_MAX_ITEMS
The number of items to publish at any time on your rss feed, default: 10
After that you can go crazy and add:
Custom Post Types
You can add them like this:
models.py:
from rsbp.models import Post
from django import models
class EventPost(Post):
when = models.DateTimeField()
description = models.TextField(blank=True, null=True)
def feed_title(self):
return "{0} at {1}".format(self.title, self.when.strftime('%x %X'))
def feed_description(self):
return self.description
EventPost.register_type()
admin.py:
from django.contrib import admin from rsbp.admin import PostAdmin from .models import EventPost admin.site.register(EventPost, PostAdmin)
templates/rsbp/event_post.html:
<h2><a href="{% url 'post' post.id post.slug %}">{{ post }}</a></h2>
<div class="rsbp-event">
{{ post.description|safe }}
</div>
<div class="rsbp-meta">
{% include rsbp/includes/default_meta.html" %}
</div>
Changelog
0.0.1 (2013-05-31)
Add tests for publishing logic
Add tests for absent or half-present slugs
Slug bugfixes
CKEditor now strips attributes from pasted text by default (this can be overridden)
0.0.0 (2013-05-30)
Initial release
Release files for rsbp 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rsbp-0.0.1.zip | 16.7 kB | Details |
Release files / rsbp-0.0.1.zip
| Download URL | rsbp-0.0.1.zip |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4cac817253369442540a309cf5cb20fefe2bfb8530e4acb73a5a98614119f69f
|
|
BLAKE2b-256 checksum How to use checksums |
44826433070524ec7bc1e4be43c88c1a07a52a92cdb3904646274783474ae9ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |