Models and views for reading a WordPress database. Compatible with WordPress version 3.5+.
django-wordpress is a project of Sunlight Foundation.
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”.
Database routers need be set to:
DATABASE_ROUTERS = ['wordpress.router.WordpressRouter']
Default templates
Default templates are provided only for development purposes so you can see content in your browser! Please override these with customized templates for your application.
Export Management Commands
wpexport Dump published posts in WXR format.
wpexportauthors Export authors as CSV.
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')),
Metadata
Release files for dj-wordpress 0.10.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 | Provenance | |
|---|---|---|---|---|
| dj-wordpress-0.10.1.tar.gz | 16.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dj_wordpress-0.10.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.2 kB
Release files / dj-wordpress-0.10.1.tar.gz
| Download URL | dj-wordpress-0.10.1.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68417a8cffe265c7758206acb83154c313595b1dd28553223003c2a59abad08c
|
|
BLAKE2b-256 checksum How to use checksums |
ed9f95585a64f6f9d6de39a7a1c81c0999005477bcd62c00176d7f815b5f8273
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / dj_wordpress-0.10.1-py3-none-any.whl
| Download URL | dj_wordpress-0.10.1-py3-none-any.whl |
|---|---|
| Size | 17.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
814a98ace4e9a266400e851af6f26cae0537c044280648667b35200cb2921888
|
|
BLAKE2b-256 checksum How to use checksums |
ec996d976e2bf089933ca5dfd3f13d5345031613e87deca1e632e87b2b52323d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for dj-wordpress 0.10.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.