Skip to main content

Django models and views for a WordPress database.

Project description

Models and views for reading a WordPress database. Compatible with WordPress version 3.1.

django-wordpress is a project of Sunlight Foundation (c) 2012.

Contributors:

Features

Read-only models to protect your content

This package is designed to be read-only. Writing is enabled by adding WP_READ_ONLY = False to settings.py. None of the WordPress specific logic is included while writing to the database so there is a good chance you will break your WordPress install if you enable writing.

WordPress table prefix

The default table prefix is wp. To change the table prefix, add WP_TABLE_PREFIX = 'yourprefix' to settings.py.

Multiple database support

Added the ability to specify which database the WordPress content is coming from. Set it using the WP_DATABASE setting. Defaults to “default”.

Default templates

Default templates are provided only for development purposes so you can see content on your screen! Please override these with customized templates for your application.

Working With WordPress Models

Ten most recent published posts:

Posts.objects.published()[:10]

Posts tagged wordpress:

Posts.objects.term("wordpress")

Post attachments:

for attachment in post.attachments():
    pass

Post tags:

post.tags()

Installation

pip install the-real-django-wordpress

Add to INSTALLED_APPS in settings.py:

'wordpress'

Include the following in urls.py:

url(r'^path/to/blog/', include('wordpress.urls')),

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

the-real-django-wordpress-0.2.tar.gz (8.6 kB view details)

Uploaded Source

File details

Details for the file the-real-django-wordpress-0.2.tar.gz.

File metadata

File hashes

Hashes for the-real-django-wordpress-0.2.tar.gz
Algorithm Hash digest
SHA256 8bd9fedb43cc4795e9c08cde0c18b16422c5442f7f04a74cadcef1404c3282e0
MD5 de6b2fac3cbf79f88a0c84431d53ec58
BLAKE2b-256 c517884a881e90b4abea89146aab8446a577b201b64b7669cad12d2fe1fbed11

See more details on using hashes here.

Supported by

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