{"name":"django-wordpress: Integrate WordPress Content into Django","description":"django-wordpress provides a robust solution for integrating WordPress content directly into Django applications. It offers read-only models and views, ensuring the safety of your WordPress database while allowing seamless access to posts, pages, and other data. This package is ideal for developers looking to leverage existing WordPress content within a Django framework.","github":"https://github.com/istrategylabs/django-wordpress","url":"https://osrepos.com/repo/istrategylabs-django-wordpress","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/istrategylabs-django-wordpress","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/istrategylabs-django-wordpress.md","json":"https://osrepos.com/repo/istrategylabs-django-wordpress.json","topics":["django","wordpress","python","django-models","web-development","blogging","cms-integration"],"keywords":["django","wordpress","python","django-models","web-development","blogging","cms-integration"],"stars":null,"summary":"django-wordpress provides a robust solution for integrating WordPress content directly into Django applications. It offers read-only models and views, ensuring the safety of your WordPress database while allowing seamless access to posts, pages, and other data. This package is ideal for developers looking to leverage existing WordPress content within a Django framework.","content":"## Introduction\n\n`django-wordpress` is a powerful Django package designed to integrate WordPress content directly into your Django applications. Developed by ISL and the Sunlight Foundation, it provides models and views for reading data from a WordPress database, compatible with WordPress version 3.5 and above.\n\nA key feature is its **read-only design** by default, protecting your WordPress content from accidental modifications. While writing can be enabled, it's strongly advised against due to the lack of WordPress-specific logic. The package also supports custom WordPress table prefixes and multiple database configurations, offering flexibility for various setups. Default templates are included for development, encouraging users to override them for production.\n\n## Installation\n\nTo get started with `django-wordpress`, follow these simple steps:\n\nFirst, install the package using pip:\n\nbash\npip install the-real-django-wordpress\n\n\nNext, add `'wordpress'` to your `INSTALLED_APPS` in `settings.py`:\n\npython\nINSTALLED_APPS = [\n    # ...\n    'wordpress',\n    # ...\n]\n\n\nFinally, include the WordPress URLs in your project's `urls.py`:\n\npython\nfrom django.urls import path, include\n\nurlpatterns = [\n    # ...\n    path('path/to/blog/', include('wordpress.urls')),\n    # ...\n]\n\n\nIf you are using multiple databases, remember to configure your database routers:\n\npython\nDATABASE_ROUTERS = ['wordpress.router.WordpressRouter']\n\n\n## Examples\n\nWorking with WordPress models is straightforward. Here are a few common examples:\n\nRetrieve the ten most recent published posts:\n\npython\nfrom wordpress.models import Posts\nPosts.objects.published()[:10]\n\n\nFind posts tagged \"wordpress\":\n\npython\nfrom wordpress.models import Posts\nPosts.objects.term(\"wordpress\")\n\n\nAccess attachments for a specific post:\n\npython\nfor attachment in post.attachments():\n    # Process attachment\n    pass\n\n\nGet all tags associated with a post:\n\npython\npost.tags()\n\n\n## Why Use django-wordpress?\n\n`django-wordpress` offers several compelling reasons for integration:\n\n*   **Seamless Integration**: Easily bring your existing WordPress blog content into a Django application without complex migrations or data duplication.\n*   **Data Safety**: Its default read-only mode provides a secure way to access WordPress data, minimizing the risk of unintended changes to your live WordPress site.\n*   **Flexibility**: Supports custom table prefixes and multiple database configurations, adapting to diverse WordPress setups.\n*   **Export Capabilities**: Includes management commands like `wpexport` to dump published posts in WXR format and `wpexportauthors` to export authors as CSV.\n*   **Developer Friendly**: Provides a clear API for querying WordPress data using Django's ORM.\n\n## Links\n\n*   **GitHub Repository**: <a href=\"https://github.com/jcarbaugh/django-wordpress\" target=\"_blank\">jcarbaugh/django-wordpress</a>","metrics":{"detailViews":2,"githubClicks":1},"dates":{"published":null,"modified":"2026-07-29T15:20:25.000Z"}}