A Simple Guide on Migrating from Django to WordPress

A Simple Guide on Migrating from Django to WordPress


Migrating Django website to WordPress can be quite a hassle, but with this simple guide, you’ll have it complete in no time! All you need to do is follow the instructions below, and your new website will be fully functional in no time.

Why migrate from Django to WordPress

The number of possible uses for a Python web application is limitless. But as your site grows, so do its requirements. In many cases, you may outgrow your existing platform and wish to migrate it to something else. No matter how much time you’ve invested in customizing a Python-based platform, there’s always a chance that another technology can serve your needs better. If you are contemplating migrating from Django to WordPress for example, it is important for you to know exactly what you will gain by making such a change and more importantly – what you will lose.

Creating the project in Django

When migrating a project from Django, you should first install all its dependencies and confirm that everything works correctly. Since Django runs only in Python 2. x, you should get your environment prepared for Python 2.7 before running any code within it. While newer versions of Python might work with your project’s dependencies, it’s best not to change it. Open up a new terminal window or command prompt session and type: pip install -r requirements/dev.txt. This command installs every package required by your project except those used by tests (more on that later). After that completes successfully, run: python manage.py synced. This creates a database and populates its initial tables with dummy data—handy when starting out with a new application that hasn’t been in use before.

Installing a web server and setting up the project

With any major project, you should start with a plan. It doesn’t matter how big or how small the project is. Don’t just jump in and begin writing code—take some time to write down what exactly it is that you want to accomplish. In other words, make a list of your overall goals first and then determine how best to achieve them. For example, if you’re building a web application with an emphasis on social media functionality, you may want more than one user profile page or an About Me section that allows visitors to comment on it. Write down all of these ideas as they come along; eventually, they will serve as your road map when everything comes together.

Converting the project into a static site

If you have a website based on a framework such as Drupal, Joomla, or WordPress, you might want to convert it into a static site. In order to do that, first, install Gatsby.js (the tool we will use for converting our project into a static site) and then configure your project with Gatsby. Now go ahead and create a new folder named public inside your root directory. The public folder will contain all of your newly generated static files (including your compiled JavaScript). Inside that folder, create an HTML file that would be used as your index page.

Creating a static theme for WordPress

A static theme is a collection of HTML, CSS, and JavaScript files that build a WordPress site. Static themes (also called skeleton themes) are different than traditional themes in that they do not use any PHP code. They provide a minimal starting point for your new site, so you don’t have to spend time writing or editing unnecessary code. Using one of these starter kits can save you hours of development time – whether you’re just learning or if you are looking for an easy way to get started with a clean theme and page layout.

Connecting the blog with Google Analytics

You’ll be able to see how much traffic your blogs are getting and where it’s coming from. You can create your Analytics account here, then go back and copy your tracking code into WordPress (assuming you’re using WordPress as your blogging platform). For example, I set up a simple analytics page for my Python Weekly newsletter. This way, people can easily get access to links back to my website. If you have trouble getting it working, try Google’s own instructions or post in their help forums for help – there are always several people who will be happy to give advice there.

Disabling permalinks in Apache2

To migrate your Django-driven site, you’ll need to disable permalinks. To do so, edit your Apache configuration file or a .htaccess file. In that file, add Options -MultiViews RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] As soon as you save and exit your text editor, permalinks will be disabled and comments will no longer work. At that point, disable any other components of Drupal that are running in Apache such as URL rewriting for your URLs (if you use mod_rewrite in Apache) or display modes.

Enabling HTTPS access in Apache2

In a previous post, we discussed how you can install a Let’s Encrypt certificate and enable HTTPS with Apache2. The procedure is straightforward, but some users may find it complicated. There are many guides available online (which tend to be outdated), but most of them aren’t as easy to follow. In an effort to make it easier for you, I’ve put together a concise guide that walks you through every step. I hope it helps!

Updating contact details in sitemap.xml file

The sitemap.xml file is used by search engines like Google, Yahoo, and Bing to index your website content. You can edit the file directly via FTP or you can use a WordPress plugin that’ll do it for you (we recommend Yoast SEO). Once it’s been updated, don’t forget to submit your changes through Google Search Console (formerly Webmaster Tools) or Bing Webmaster Tools. Each site has its own verification process—Google usually requires you manually verify each of your domains while Microsoft only requires one domain to be verified. If you have multiple sites, repeat these steps for each of them.

Adding search functionality in Apache2

One of the simplest ways to add search functionality in Apache2 is by configuring the mod_lsearch module. With mod_lsearch, users can use a Web browser or a stand-alone application (such as Google Desktop Search or X1) to do very fast keyword searches in an Apache2 HTTP server’s data and documents. On top of that, search also caches its searches using Memcached making subsequent searches very fast even if they’re not totally up-to-date. Let’s see how we can configure it on our Ubuntu 12.04 box running a LAMP stack

Setting up redirects in Apache2

A simple way of redirecting traffic from one domain name to another is by using Redirect directives in your Apache2 configuration.

Next steps

– Make a list of all your current customers/clients. 

– Mail them or directly call them and let them know that you are going to be moving over to using WordPress as your CMS. (If you’re planning on quitting your job, don’t just quit without notifying everyone. Depending on how many clients you have, it may take up a lot of time for example if you had 50 clients.) 

– Write down all your hosting information including the domain name and where it is hosted.


What are the benefits of switching from Django to WordPress? There’s also a reason why you might opt to have a custom website built: because it’s nearly impossible for you to get it done on your own. The problem is that many small businesses start with pre-made solutions like WordPress and then realize they need some custom features. Or they outgrow them (and then either abandon their site or hire someone else). No matter what, in-house development has two major advantages over- relying on external tools: The first is control: nobody but you can access your data with an open-source solution. A second advantage is time management. WordPress is often installed for free, and it doesn’t require maintenance or setup costs. And we know all the info we shared with you might sound like technobabble to you but do not worry you can always hire a Website development company or go to a WordPress developer for giving you a hand with all technical stuff.

Leave a Reply

Your email address will not be published. Required fields are marked *