/Render_Database_Backup_Script_For_Django

This repository contains the code which helps us to Take Backup Data from Render Database in the form of CSV File. This works well in Django Website.

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Render Database Backup Script

This script exports data from a Django model and saves it to a CSV file. It is designed to be used as a backup mechanism for your Django project.

We all know that Render provides free database service for 3 months. But, in free tier plan, the database will be deleted after 3 months and also we cannot take backup.

So, for taking backup of the data, you can make use of this script. The data will be stored in CSV format. Follow the instructions below and get your backup now!

Requirements

  • Python 3.x
  • Django

Setup

  1. Clone the repository:
  2. git clone https://github.com/ravin-d-27/Render_Database_Backup_Script_For_Django.git
  3. Install the required dependencies:
  4. pip install -r requirements.txt

Usage

  1. Open the Backup_Script.py file.
  2. Modify the following variables to match your project:
    • Your Project Name.settings: Replace with the actual path to your Django project's settings module.
    • yourapp: Replace with the actual app name from your Django project.
    • yourModel: Replace with the actual model name from your Django project
    • fieldnames: Replace with the actual field names from your Django model.
  3. Save the script where manage.py file is located.
  4. Run the script:
  5. python backup_script.py

    This will export data from the specified Django model to a CSV file.

Configuration

  • DJANGO_SETTINGS_MODULE: Set the Django settings module path.
  • fieldnames: Specify the field names to be exported to the CSV file.
  • backup_file_path: Define the path for the CSV backup file.

Contributing

Feel free to contribute by opening issues or submitting pull requests.

License

This project is licensed under the GNU GENERAL PUBLIC License - see the LICENSE file for details.