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.

Python Django Tutorial | Django Course

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 &...

This Python Django tutorial will help you learn what is django web development & application, what is django and introduction to django framework, how to install django and start programming, how to create a django project and how to build django app. There is a short django project as well to master this python django framework.

Why should you watch this Django tutorial?

You can learn Django much faster than any other programming language and this Django tutorial helps you do just that. Our Django tutorial has been created with extensive inputs from the industry so that you can learn Django and apply it for real world scenarios.

Linux Tutorial - Shell Bash Commands from the Beginning with Examples

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.

Linux Tutorial - Shell Bash Commands from the Beginning with Examples

Learn BASH command interpreter explained step by step and with examples.

In this course you will learn to use a command interpreter in Linux. I will teach you all the necessary concepts from the beginning and step by step, so you will have a good base on which to expand your skills with this powerful way of using an Operating System. Whether you are initiated in its use or if you have never seen it, you will take advantage of the explanations and exercises that I am going to teach you.

In the first topic I will explain what Linux is and how the command interpreter fits into the operating system. You will also see how to install it using a virtual machine so you can do all the practices and experiments you want without fear that your computer will suffer some damage.

In the second block you will learn to manage the elements of the filesystem: files and directories. You will understand how they are organized and you can move about the directory structure quickly and effectively. You will also learn how to create, change or delete both files and folders.

Like Linux in a multi-user system, in the third topic you will know how users, groups and permissions are organized.

Finally you will learn to install software from official servers or from any compatible file. You will hallucinate with the amount of free programs that you can enjoy in a few seconds.

Do not hesitate, take the course and lose your fear of the console mode, your computer skills will grow exponentially!

What you'll learn

  • 🐧 Get and install Linux
  • 🏼 Understand the structure and syntax of Linux commands
  • ❓Get quick help from any system command
  • 📂 Manage your files and folders quickly and effectively
  • 🛠 Use all the tools offered by the command interpreter to be more efficient using Linux
  • 💡Understand and manage concepts such as file system paths, both relative and abusive
  • 👨‍💻Create users and assign them permissions and passwords
  • 💿 Install and configure the large amount of free software offered by Linux
  • 🕸 Modify system repositories
  • *️⃣ Use wildcards and file system shortcuts
  • 💻 Know the information offered by the system prompt