PythonAnywhere is one of the most popular Django hosting server platforms where you can host and run your Django website.
In an earlier tutorial, I have explained to you how to host and run your Django website on PythonAnywhere. In this tutorial, I am going to explain to you the steps to take the Django website backup.
We all know how crucial it is to take the backup regularly. Taking backup regularly can be very useful to restore your website in case any mishap happens.
You can take the backup of your Django project manually. By doing it manually, you don’t need to pay anything extra (Completely FREE).
These steps include simple commands. Let’s follow them one by one.
(project_name.pythonanywhere.com) 17:28 ~ $ cd ../ (project_name.pythonanywhere.com) 17:28 ~ $ pwd /home/account (project_name.pythonanywhere.com) 17:28 ~ $ ls README.txt project_name.pythonanywhere.com static (project_name.pythonanywhere.com) 17:28 ~ $
These are just basic Linux commands.
project_name.pythonanywhere.com
. Create the zip bundle using below command.$ zip -r backup_file_name project_name.pythonanywhere.com
It will take some time to create the zip bundle based on your project directory size. Once it is done, you can download the bundle.
Files
.It will start downloading the backup file on your local system.
Once you download files from pythonanywhere, you have to verify them.
You can unzip or extract the downloaded zip bundle to see all the backup files. Make sure it has all your project files including the database file. Keep this zip file for future use.
With some sort of Python scripting, you can also automate these steps for backing up the project and database files.
I hope you find these steps to take a backup on PythonAnywhere manually simple and easy. If you find any difficulties taking backup, let me know in the comment below.