Skip to content

Instantly share code, notes, and snippets.

View oesah's full-sized avatar

Özer S. oesah

View GitHub Profile
@oesah
oesah / djangocms_blog_import.py
Created June 13, 2017 22:51 — forked from yakky/djangocms_blog_import.py
Import posts from wordpress to djangocms_blog
def import_wp(language):
from django.template.defaultfilters import truncatewords_html
from cms.api import add_plugin
from wordpress.models import Post as WPost
from djangocms_blog.models import Post, BlogCategory
from django.contrib.auth.models import User
for post in WPost.objects.published():
print post.title