How to Solve NameError: name 'connections' is not defined -- django
Solution: Import the 'connections' module
To Solve the error, add the following line to the top of your code.
from django import connections
For more information:
Python django connections