Christopher Merle

Que sera, sera, whatever will be, will be, but first I need more coffee.

Category: Python (page 1 of 3)

WordPress to Plone

The time has come for me to move away from WordPress. I’ve been saying that for a while. I realized that I could migrate to Wagtail which is a CMS that sits on top of Django, but it requires some assembly. However, I can migrate to Plone much faster, and that is what I intend to do.

I  will continue to support my existing WordPress clients and won’t push them to migrate to Plone. One or two might benefit, but WordPress is a good platform and is well supported. Why should they have to pay for a site twice? I worked with Plone extensively in the past, but not recently. I am looking at it again and it has improved dramatically and is no longer just for enterprise level websites. It can fill some of the niche that WordPress does.

I’m going to give myself 30 days from today to migrate my site to Plone. I still want to work with Wagtail, but mostly I want to work more with Python. It’s my favorite computer language. PHP not so much which is what WordPress is written in. The WordPress community is large, active, and makes up for the shortcomings of the language.  The developers of the language have continued to make it more robust and secure, but that is not where my interests lie.

You have to go with what works for you. Python is easier to maintain and easier for me to figure out what the code of some project is doing if I look at it.

Is it time for Python 3?

I’d known that someday I’d have to start using Python 3. In fact I’ve wanted to but never got around to it. Part of it was the Python software I’ve been using, Plone is still in Python 2 and even with the most recent release of Plone 5 it’s still not there yet. They do plan on porting it to 3, but unsure of their timetable. Django on the other hand has been Python 3 for a little while now. Although I’ve wanted to move away from WordPress I hadn’t quite found a Django based CMS (content management system) that was as fully developed as WordPress. Plone is an awesome CMS but it is overkill for most of my clients, as they are individuals or small businesses.

Anyway, Python 3 was released in 2008, so it being 2015 I think it’s time. And I believe I have found a Django based CMS that will make it possible for me to move away from not only WordPress but also Plone. Both of them are ready go out of the box. This one isn’t and some assembly is required. Nor is it an exact replacement. It’s called Wagtail. I’d looked at some other Django based CMSes (including Django CMS), and I’d settled on Mezzanine for a while, but when I migrated to a new server on a python friendly host, I ran into some difficulties in re-installing Mezzanine. I’d resolved those difficulties but using Python 2.  There is no difficulty in using Python 3 though.

I’ve been making my development process more rigorous than I had in the past. I wasn’t so rigorous with WordPress which is written in PHP.  I need to be more so with Python as my work needs to be repeatable and better documented. I don’t develop in WordPress, I just customize child themes and add plugins if need be (which I try to avoid because updates wipe out  changes). There’s so many add ons and themes available, very little programming is necessary and many host providers have one click WordPress setups now and offer managed services (which is great).

To make my Python development process more rigorous I use virtual environments. This way I’m not polluting my OSes Python. And virtualenvwrapper is so much nicer than plain old virtualenv. I hadn’t forgotten about using version control. I’ve settled on git and I may write about that in future posts.

To use Python 3 make sure it’s installed on your computer whether it be Linux, MacOS or Windows. At a command prompt just type python3 –version and hit return. If it’s there you are good to go. You can make sure pip for 3 is installed by issuing the command pip3, though it’s not necessary when using virtualenvwrapper.

It’s fairly straightforward to getting virtualenvwrapper to create a python3 project just issue the following command:

$mkproject --python=path_to_python3 project_name
(project_name)user@ubuntu:~Devel/project_name$
$which python

to verify you are indeed using Python 3. And then you can pip install your little heart out.

Note: I’m not abandoning my existing WordPress customers. It’s a good platform and I’ve been working with it for over 10 years. It has a large development community and large user base. I don’t plan to take any new clients on for it, but it doesn’t mean I won’t. Since Wagtail requires more work I’ll have to seek out different clientele for it once I’m ready. This is a transition period for me. I plan on converting a few sites, the first of which is this one. I want to do more programming and I’m more productive in Python than PHP. It’s also easier for me to maintain my code and understand it. I don’t have to do a lot of programming with WordPress.

Wagtail, part the first

Seriously considering moving my website away from WordPress to a Django CMS (not Django CMS). There are a lot to choose from. Mezzanine was recommend to me and I had gained some familiarity with setting one up and was about ready convert a small Plone website to it. Plone was overkill for it. I ran into some difficulties in setting up Mezzanine on one of my host providers and in doing research on various Django CMSes (was seriously looking at Django CMS) also read a description of Wagtail, one the newest content management systems that sits on top of the Django web framework.

My preferred programming language is Python. Alas, WordPress is written in PHP. PHP is fine. It owes it’s origins to Perl, but I find I’m more productive in Python and it’s easier and cleaner to maintain. Also, there are a bunch of great people in the Python community (though I have found a bunch of great people in the WordPress and JavaScript communities in Tucson).

Wagtail isn’t a ready to go out of the box CMS like WordPress or Plone and does require work in setting it. Even Mezzanine is more ready to go out of the box. For a low cost web host, you really can’t beat WordPress. It is everywhere and there are a large number of developers who make, themes and plugins for it. They help to make up for the shortcomings of PHP.

I’ll have more to say as I learn about Wagtail in future posts and my possible journey from WordPress to it.

Python and PHP

I started another post entitled Python vs. PHP. It’s quite long and not ready to be published. I use both languages or rather products that use those languages. I use PHP based WordPress for most of my clients’ sites and my own. I use Python based Plone for just a few of my clients.

I’m trying to decide if I want to continue with this mix of Python and PHP or focus on one more than the other. This article gives a good informed basis for helping me decide.

Python vs. PHP
https://wiki.python.org/moin/PythonVsPhp

Facebook Test

This is a test of the facebook plugin for WordPress.

Older posts

© 2017 Christopher Merle

Theme by Anders NorenUp ↑