Remove Database settings of django using bash script

Remove Database settings of django using bash script

I am trying to create a bash script to create a boilerplate django project that suits for my company. I need to delete the DATABASES in settings and append new one. The DATABASES is a python dictionary with structure

I am trying to create a bash script to create a boilerplate django project that suits for my company. I need to delete the DATABASES in settings and append new one. The DATABASES is a python dictionary with structure

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}

For this I tried something like this

sed -i -e "/DATABASES = {/,/}/d" settings.py

But it resulted in a trailing }.

The output is

}

I understood that the pattern it matches is for the first curly braces but not the second. What should be the approach for this.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Python Django Tutorial | Django Course

🔥Intellipaat Django course: https://intellipaat.com/python-django-training/ 👉This Python Django tutorial will help you learn what is django web development &...

Linux Tutorial - Shell Bash Commands from the Beginning with Examples

Linux Tutorial - Shell Bash Commands from the Beginning with Examples. Learn BASH command interpreter explained step by step and with examples. Learn what Linux is and how the command interpreter fits into the operating system. Get and install Linux. Understand the structure and syntax of Linux commands. Learn to manage the elements of the filesystem: files and directories. Learn to install software from official servers or from any compatible file.

How to Integrate Django to any Javascript Front End // Django to React // Django to Angular

Learn the basic technique to Integrate Django to any Javascript Front End // Django to React // Django to Angular