pip install django-wordpress python INSTALLED_APPS = [ ... 'wordpress', ... ] python WORDPRESS_HOST = 'https://your-wordpress-site.com' WORDPRESS_USERNAME = 'your-wordpress-username' WORDPRESS_PASSWORD = 'your-wordpress-password' python from wordpress.models import Post, Category all_posts = Post.objects.all() post = Post.objects.get(id=1) new_post = Post(title='Hello World', content='This is my first post.', status='publish') new_post.save() category = Category.objects.get(name='Technology') category_posts = category.post_set.all()


上一篇:
下一篇:
切换中文