A full-featured blogging application for your Django site
Project description
django-xblog
Blogging application for your Django site
Build Status
Installation
From github:
pip install https://github.com/rubeon/django-xblog/archive/master.zip
Using git:
mkdir blog_project
cd blog_project
virtualenv .
. bin/activate
git clone git@github.com:rubeon/django-xblog.git
cd django-xblog
python setup install
This will install xblog and its requirements.
Creating a Site
After the above, go through the usual process:
django-admin startproject mysite
vi mysite/settings
Add the dependencies to INSTALLED_APPS
:
INSTALLED_APPS = [
...
# following are for xblog
'django.contrib.sites',
'bootstrap3',
'markdown_deux',
'xblog',
]
# Define a site, if not done already!
SITE_ID=1
URL Setup
Add a place to your site's root urls.py
reach your blog, and don't forget to
add the xblog
namespace:
import xblog.urls
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^blog/', include(xblog.urls, namespace="xblog"),
]
Creating users
XBlog uses the Django authentication framework to keep track of users. Users
are linked to Authors
, which can serve as the User profile model.
Author profiles are created automatically in the User
model's post_save
signal. See xblog/models.py:create_profile
for reference.
Adding to your templates
XBlog defines the following content blocks:
-
maincontent
- the main Blog content with archives, posts, etc. -
rightnav
- Blog roll, archive links, etc. -
leftnav
- navigation block including ...(FIXME: whut?) -
extrahead
- adds meta tags depending on the content being shown:
<title>subcritical.org::{% block subpagetitle %}top{% endblock %}</title>
{% block extrahead %}{% endblock %}
subpagetitle
- returns title of article or archive
<title>subcritical.org::{% block subpagetitle %}top{% endblock %}</title>
pagestyle
- can be placed inbody
tag for CSS styling:
<body class="{% block pagestyle}{% endblock %}">
-
<title>subcritical.org::{% block subpagetitle %}top{% endblock %}</title> {% block extrahead %}{% endblock %}blogheaders
- Returns metadata about blog, such as EditURI, author, etc., for you HTML<head>
section -
navigation
- Can be pulled into your navigation block to allow blog-specific navigation elements:
<nav>
<ul>
<li>Top</li>
{% block navigation %}{% endblock %}
</ul>
</nav>
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django_xblog-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 541e5b6e8593689824a1669c8a7bd6f758fe266483d169bfdbc498eae3263e8a |
|
MD5 | 7bc79f8718525d94b4c5c2df2b055b85 |
|
BLAKE2b-256 | eea2755f4af867184c73dc334be1eb120b76504493ef99fb1ed8781dc8950d0f |