A WordPress-like blog app implemented in Wagtail.
After reimplimenting WordPress-like blogs over and over again in Wagtail I decided to just make this. Feel free to use as is or copy it as a starting point. It's based on the Wagtail demo blog but is closer to a standard WordPress blog style.
This is a starting point for your wagtail based blog, especially if you are migrating from Wordpress. It's not Wordpress and it's not drop in. You are expected to add your own templates and are given on a skeleton template to start from.
- Categories and tags with views
- RSS
- Basic starter templates with pagination
- Comments
- WordPress importer
Work in progress?
- Disqus comments
You should start with a existing wagtail django project and have a basic understanding of Wagtail before starting. See http://docs.wagtail.io
pip install wagtail-blog
- Add
blog
to INSTALLED_APPS - Add
url(r'^blog/', include('blog.urls', namespace="blog")),
to urls.py python manage.py migrate
- Override templates as needed.
BLOG_PAGINATION_PER_PAGE
(Default 10) Set to change the number of blogs per page. Set to None to disable (useful if using your own pagination implementation).BLOG_LIMIT_AUTHOR_CHOICES_GROUP
Optionally set this to limit the author field choices based on this Django Group. Otherwise it defaults to check if user is_staff. Set to a tuple to allow multiple groups.BLOG_LIMIT_AUTHOR_CHOICES_ADMIN
Set to true if limiting authors to multiple groups and want to add is_staff users as well.
The import feature requires django-contrib-comments
and django-comments-xtd
- Enable WordPress JSON API
- Create a Blog index page and note the title. Let's pretend my blog index page title is "blog"
- Run
./manage.py wordpress_to_wagtail blog --url=http://myblog.com username password
the username is your WordPress username with full access to the API. Without this you can't access all blog posts.
This works by getting the json data for your posts and making Wagtail pages for them. It then downloads any images it finds and replaces urls to use your site instead of an external site. Blog authors will become Django users. This is a complex process and is prone to error. You should plan to review the import code and fix some issues. Pull requests welcome to improve this feature.
- Create a WordPress XML dump by selecting "export" from the "Tools" section of the WordPress admin page.
- Create a Blog index page and note the title. Let's pretend my blog index page title is "blog"
- Run
./manage.py wordpress_to_wagtail blog --xml=export.xml
where export.xml is the XML export file from your source WordPress site.
The xml importer uses the lxml library.
This feature was tested on wordpress XML exports from exactly one site. Like the import procedure above, this process is complex and prone to error.
This process currently will not import comments.
django-comments-xtd comments work out of the box. Just install it as directed here. Customizing the xtd comment templates should be all you need - but feel free to review this app's templates which you may want to override.
Out of box Disqus coming someday - but it's pretty easy to add manually following the Disqus documentation and overriding templates.
Feel free to contribute other comment implimentations.
The included docker-compose file should make it easy to get up and running.
- Install docker and docker-compose
docker-compose up
docker-compose run --rm web ./manage.py migrate
docker-compose run --rm web ./manage.py createsuperuser
- Log in and create a blog index page with blog pages to see a very basic implementation.