https://github.com/jcarbaugh/django-wordpress
WordPress models and views for Django.
https://github.com/jcarbaugh/django-wordpress
django django-models python wordpress
Last synced: about 1 month ago
JSON representation
WordPress models and views for Django.
- Host: GitHub
- URL: https://github.com/jcarbaugh/django-wordpress
- Owner: jcarbaugh
- License: bsd-3-clause
- Created: 2009-03-27T17:34:59.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2021-06-07T15:49:55.000Z (over 4 years ago)
- Last Synced: 2025-04-02T13:29:32.611Z (8 months ago)
- Topics: django, django-models, python, wordpress
- Language: Python
- Homepage:
- Size: 88.9 KB
- Stars: 358
- Watchers: 28
- Forks: 81
- Open Issues: 5
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-python-resources - GitHub - 18% open · ⏱️ 24.01.2018): (第三方 API)
README
================
django-wordpress
================
Models and views for reading a WordPress database. Compatible with WordPress version 3.5+.
django-wordpress is a project of `ISL `_ and the `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')),