At the start of any programming project, the biggest decision is choosing the right tool for the job. This decision will be a crucial factor which affects the rest of the project. In the early stages of this website, I used WordPress. Despite the fact that WordPress was a blessing and made life so much easier, I was eager to switch to something else more lightweight.
WordPress is an open-source content management system (CMS), built using the PHP language, it can be used to quickly produce a website and establish an online presence. With the built-in admin dashboard, tools and a vast plugin and theme library, it is extremely powerful and comes with a great deal of scalability.
Django on the other hand is not a CMS, It’s actually a web framework. Built using the Python programming language, it’s simply a set of tools and libraries which can be used to rapidly deploy a custom web application.
WordPress boasts its installer which only takes 5 minutes to get a website up and running from scratch. From my experience with past installs, it actually takes less time than that!
Not only this, but WordPress can be used without any prior programming knowledge. This makes it extremely simple, and a no-brainer option for people who want a website quickly and without coding even one line of code. Of course, some code is required to install WordPress on a server, but often, people who use WordPress are using a hosting provider with a cPanel interface that includes the one-click installer of WordPress. Even if you’re installing WordPress on your own server, there is plenty of documentation on the internet with help on getting it set up.
Once you’ve managed to get WordPress installed, you can start right away constructing the rest of your website by adding pages and posts using the default WordPress theme. You can also download your own theme using the WordPress theme library, there are so many to choose from, you’ll pretty much be spoilt for choice there. You can even set up a website-builder-Esque interface using a plugin such as Elementor if you don’t like the WordPress built-in block editor.
WordPress is SEO heaven. It has many plugins and themes which can be used to optimise SEO and are SEO friendly. It is quite easy to rank up the search results with a WordPress site.
I’m not a WordPress hater, in fact, WordPress is the main reason why I even decided to create an online presence for myself. In the initial stages, when I had no programming knowledge, I was able to build a really nice website using it.
WordPress isn’t lightweight. It’s quite bulky, especially as soon as you start to install a few dozen plugins and have many posts. This means, with a slightly bigger website, you can no longer use free hosting solutions on the internet.
I host my WordPress websites on an ancient PC that I have at home. With a dual-core Intel Pentium, 2GB of RAM and a 160GB HDD, it isn’t the top-spec enterprise server you may have anticipated, but despite the lacklustre hardware, it is actually more than sufficient for a web hosting server. As it’s connected to my fibre-optic broadband through ethernet, website load times are very impressive.
There is one problem. The PC is bulky and noisy. As wired is the only option for internet connection (wireless slows down drastically), the PC has to be kept in the living room right beside the router. Even after setting fan curves where the fans are off up until the CPU reaches a toasty 80°C, it still collects a lot of dust, causing it to heat up even quicker. And don’t even get me started on the power consumption, this PC is ridiculously inefficient. Of course, this is expected as this PC is (at the time of writing) almost 12 years old.
Back when I was younger and was getting into programming and general electronics, I was gifted a Raspberry Pi 1 B+. At that time, this was the latest and greatest Raspberry Pi model, but compared to the models you can get today, the performance is nowhere near as good.
Needing only 5 watts of power to run, this is the perfect server option to host my website. It is silent (no fans) and is really small. But the hardware was a problem. With a 700MHz Broadcom BCM2835 CPU and 512MB of RAM, it would really struggle to host a fairly large WordPress site. With a test WordPress install with around 10 plugins and several dozen pages and posts, SQL queries took an eternity, and the website was incredibly sluggish.
This is where Django comes in. Within around about a month, I was able to learn Django and produce this website. Of course, it isn’t quite the 5 minutes it takes to get a WordPress site up and running but Django is completely different.
After building the site and pushing it to my Raspberry Pi, I was greeted with the quick page load times, despite not even setting up a proper hosting environment and serving the website directly from the Django built-in web server (not recommended on a production environment!).
Despite the need of programming knowledge, I was quite surprised with the simplicity of creating a website with Django.
WordPress is the easiest to use, from installation to customising, the user isn’t required to have any programming skills. Django is used to build a website from scratch, you’re required to have a good knowledge of Python.
WordPress is much more popular compared to Django as it is much easier to use. Django is less preferred as it does require some technical knowledge.
WordPress has a large history of security bugs and vulnerabilities. This is mainly due to the way WordPress is built, with downloadable themes and plugins. Even if one theme or plugin has an exploit or vulnerability then a WordPress website can be easily hijacked. Django on the other hand is a bit different. You’re in charge of security and minimising exploits and vulnerabilities. Although this sounds quite complicated, it really isn’t, as it is much easier to remove exploits and vulnerabilities.
Hosting wise, almost all web hosting providers support PHP. PHP is widely used in the web industry. Although Python isn’t a very well supported language in the web industry, you’ll have a slightly more difficult time finding a hosting provider who supports it, you might even end up having to buy a virtual private server (VPS). But Python is one of the best programming languages (at least in my opinion), it is easy to learn and extremely powerful and versatile, it can be used to produce better projects in a shorter amount of time. Luckily, Django is built on and uses Python which makes life a whole lot easier.
With my website now running on the Django framework, I have full control over it. Due to this, I have been able to add extra features such as storing all media to a free Dropbox account instead of storing it locally. I’ve even managed to make my website lighter, giving me a 150% increase in performance (according to Google’s PageSpeed Insights).
There are a lot of features missing, unfortunately. With WordPress, I’d have been able to add these missing features with a few clicks using a plugin, but with Django, I have to code it myself. The backend editor I use on Django, TinyMCE, is nowhere as good as WordPress’ block editor.
It’s quite easy to forget that Django is not a CMS out of the box.
Learning Django has been a fun, month-long, adventure, showcasing my progress is this website.
Although It is completely possible to make your own CMS with Django, why reinvent the wheel? In the future, I will start to implement Wagtail CMS, which is an open-source CMS built on Django. This CMS is great not only because it is built using Python and Django, but also because of the heaps of features it includes, and its SEO friendly.
I am also thinking about investing in a more powerful server, Raspberry Pi or equivalent computer, OrangePi, for example. This way I’ll hopefully be able to move all of my WordPress sites into a Django equivalent.
WordPress is extremely versatile and scalable; Django can be even more versatile and scalable if you have good knowledge in Python.
WordPress is quick and easy, takes less than 5 minutes to install; Django takes a lot longer as you have to code.
Django is much safer as there are less, if not none, exploits and vulnerabilities compared to WordPress.
Django is a better solution compared to WordPress if you have the technical skills and are willing to spend a lot of your time.
← Back to blog
More posts in Programming Adventures →
All categories →