Skip to main content

A full-featured blogging application for your Django site

Project description

django-xblog

Blogging application for your Django site

Build Status

Build Status PyPI version

Installation

Install from PyPi:

    pip install django-xblog

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
cd mysite/
vi mysite/settings

Add the dependencies to INSTALLED_APPS:

    INSTALLED_APPS = [
        ...
        # following are for xblog
        'django.contrib.sites',
        'markdown2',
        'xblog',
    ]
    # Define a site, if not done already!
    SITE_ID=1
    MIDDLEWARE = [
        # add sites middleware
        # ...
        'django.contrib.sites.middleware.CurrentSiteMiddleware',
    ]
./manage.py migrate
./manage.py createsuperuser --username=admin --email=admin@example.com
Password:
Password (again):
Superuser created successfully.
./manage.py runserver 

URL Setup

Add a place to your site's root urls.py reach your blog, and don't forget to add the xblog namespace:

    from django.urls import path, include
    import xblog.urls

    urlpatterns = [
        path('admin/', admin.site.urls),
        path('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 in body tag for CSS styling:
<body class="{% block pagestyle}{% endblock %}">
  • blogheaders - Returns metadata about blog, such as EditURI, author, etc., for you HTML <head> section

    <title>subcritical.org::{% block subpagetitle %}top{% endblock %}</title> {% block extrahead %}{% endblock %}
  • 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

django_xblog-0.2.2.tar.gz (148.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_xblog-0.2.2-py3-none-any.whl (190.9 kB view details)

Uploaded Python 3

File details

Details for the file django_xblog-0.2.2.tar.gz.

File metadata

  • Download URL: django_xblog-0.2.2.tar.gz
  • Upload date:
  • Size: 148.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for django_xblog-0.2.2.tar.gz
Algorithm Hash digest
SHA256 2ce7de75663a1a03f6097d8909fd75197e9f981a3e6a62e0863e80f2fd391b09
MD5 d0f2676558d9c71a62a064e20e6fd0ea
BLAKE2b-256 a63ad9a1a9fa2817494982b3b734a6aec8eb00682a839bac3e533a4fb99b347e

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_xblog-0.2.2.tar.gz:

Publisher: python-publish.yml on rubeon/django-xblog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_xblog-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: django_xblog-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 190.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for django_xblog-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 61e6948bb2593cb158432d6aca70397b81b2007bdcefc873eaf1d1b6385775e1
MD5 52e3becce5fed71d0656adb8e5d7c18e
BLAKE2b-256 461af46a9fc0fe3d0159f843196d2fa94194c4a99d27f067af660184195685e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_xblog-0.2.2-py3-none-any.whl:

Publisher: python-publish.yml on rubeon/django-xblog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page